Before and After Triggers?

Поиск
Список
Период
Сортировка
От Michael Black
Тема Before and After Triggers?
Дата
Msg-id l0yF4.13512$9m6.534094@newsread1.prod.itd.earthlink.net
обсуждение исходный текст
Список pgsql-general
Will PostgreSQL handle both a Before and an After
trigger on a single table?

Here is the deal...
I have several primary tables that use a serial datatype
for the primary key of the table.  This key will need to
be returned to the calling program for display showing
that the record/row has actually been inserted into the
database table.  However, prior to inserting this
record/row I need to populate a timestamp and userid.

I guess what I could do is have the program get the userid
and the timestamp prior to insertaion and pass then with
the rest of the data.  Then perform a select for the userid
and timestamp used in the insert to get the recid, or primary
key, for display.

Any thoughts on how I can return the record id fron the trigger?

Michael Black



В списке pgsql-general по дате отправления:

Предыдущее
От: "Nilesh A. Phadke"
Дата:
Сообщение: Embedded SQL -- ecpg
Следующее
От: Victor Manuel Jaquez Leal
Дата:
Сообщение: Re: Apache::Session in PostgreSQL