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

-- 
[]s
Dickson S. Guedes
Administrador de Banco de Dados
Projeto Colmeia -  Florianópolis, SC
(48) 3322-1185, ramal: 26

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

Responder a