Before and After Triggers? - Mailing list pgsql-general

From Michael Black
Subject Before and After Triggers?
Date
Msg-id l0yF4.13512$9m6.534094@newsread1.prod.itd.earthlink.net
Whole thread Raw
List 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 by date:

Previous
From: "Nilesh A. Phadke"
Date:
Subject: Embedded SQL -- ecpg
Next
From: Victor Manuel Jaquez Leal
Date:
Subject: Re: Apache::Session in PostgreSQL