Re: Triggers with arguments - Mailing list pgsql-general

From Scott Holmes
Subject Re: Triggers with arguments
Date
Msg-id 200007130008.RAA14516@scotts.mynetwork.net
Whole thread Raw
In response to Re: Triggers with arguments  (Richard Harvey Chapman <hchapman@3gfp.com>)
List pgsql-general
What I'm after are triggers on delete fro several tables calling the same
procedure.  I am not at liberty to change the schema of the database as I need
to accomodate what is actually an ancient system - that goes back before the
days of blobs and large text fields.  In my example, deleting a record from
the "location" table, the trigger needs to delete associated rows from the
notes table.  The notes table is indexed by fields for 1) a table name (in
this case "location", and 2) a record key (the value of the primary field in
the location table).

In postgresql, the trigger execute a procedure that must be defined with no
arguments and returning opaque.  What I don't know how to do is write a
procedure that knows the values for the notes table index key (table name and
primary key value).  Examples in the manual indicate that arguments may indeed
be passed, and it refers to such procedures as general trigger functions.  I,
however, have not been able to figureout how to write such functions.

Thanks, Scott



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Figured it out (psql and Gnu readline)
Next
From: Erich
Date:
Subject: Re: Figured it out (psql and Gnu readline)