Em Seg, 2008-10-06 às 16:31 -0300, Dickson S. Guedes escreveu:
> Antonio Prado escreveu:
> > Ainda necessitando de ajuda: O que está errado?
> >
> >
> > CREATE OR REPLACE FUNCTION teste() RETURNS TRIGGER AS 
> > 'DELETE FROM cliente WHERE cliente_id = OLD.cliente_id;' 
> > LANGUAGE plpgsql;
> >
> > CREATE TRIGGER teste AFTER DELETE ON cliente_teste
> > FOR EACH ROW EXECUTE PROCEDURE teste();
> >
> >
> > ERROR:  syntax error at or near "DELETE"
> > CONTEXT:  compile of PL/pgSQL function "teste" near line 1
> >   
> 
> Ola Antonio,
> 
> Só uma dúvida, porque você não utiliza opção "ON DELETE CASCADE" [1]?
> 
> [1] 
> http://www.postgresql.org/docs/current/static/ddl-constraints.html#DDL-CONSTRAINTS-FK
> 

Não me é possível utilizar ON DELETE CASCADE devido a regra de
relacionamento entre as tabelas.


-- 
Antonio Prado
(62) 8174 4383
(62) 3278 0111
www.antonioprado.eti.br
[EMAIL PROTECTED]


_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a