Re: Triggers with arguments

Поиск
Список
Период
Сортировка
От Scott Holmes
Тема Re: Triggers with arguments
Дата
Msg-id 200007130008.RAA14516@scotts.mynetwork.net
обсуждение исходный текст
Ответ на Re: Triggers with arguments  (Richard Harvey Chapman <hchapman@3gfp.com>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Figured it out (psql and Gnu readline)
Следующее
От: Erich
Дата:
Сообщение: Re: Figured it out (psql and Gnu readline)