[Postgresql-it] trigger

  • From: "scotty" <scotty@xxxxxxxxxxxx>
  • To: postgresql-it@xxxxxxxxxxxxxxxxx
  • Date: Tue, 04 May 2004 16:10:44 +0100

Scusate la banalita' del quesito ma e' la prima volta che scrivo un trigger
per postgresql.

Allora ho una tabella T1:

C1    |     C2
---------------
bigint    bigint

ho una funzione del tipo

CREATE FUNCTION AGGIORNA(int,int) RETURNS void AS '
UPDATE T1 
set C2 = C1 - $1
where C1 = $2;
' LANGUAGE SQL;

che voglio azionare sull'evento after insert della tabella T1.

Qualcuno puo' darmi una mano con la sintassi corretta?

Grazie Enrico

Other related posts: