Re: [SQL] Why must the function that a trigger calls return "opaque" ??? - Mailing list pgsql-general

From Josh Berkus
Subject Re: [SQL] Why must the function that a trigger calls return "opaque" ???
Date
Msg-id 200208291105.25725.josh@agliodbs.com
Whole thread Raw
In response to Why must the function that a trigger calls return "opaque" ???  ("Greg Patnude" <GPatnude@adelphia.net>)
List pgsql-general
Greg,

> This seem rather limiting...  Suppose I want a trigger that after insert,
> returns the currval(sequence) of the newly inserted row automatically
> without having to run another query ???

Because you can't capture the return value of a trigger.  The trigger is
returning the new/altered/deleted row.

If you want a function to return a value, don't use a trigger.

--
-Josh Berkus
 Aglio Database Solutions
 San Francisco


pgsql-general by date:

Previous
From: olga@home-medicine-usa.com (Olga)
Date:
Subject: SET TIME ZONE problem
Next
From: gary.beberman@mindspring.com (Gary Beberman)
Date:
Subject: How to uninstall PostgreSQL on OS X