Re: [SQL] Why must the function that a trigger calls return "opaque" ???

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: "Greg Patnude" <GPatnude(at)adelphia(dot)net>, pgsql-general(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] Why must the function that a trigger calls return "opaque" ???
Date: 2002-08-29 18:05:25
Message-ID: 200208291105.25725.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Robert Treat 2002-08-29 18:08:42 Re: Question about our postgres-related product
Previous Message Neil Conway 2002-08-29 17:55:42 Re: [Pgreplication-general] Master/Slave is in town!

Browse pgsql-sql by date

  From Date Subject
Next Message Marie G. Tuite 2002-08-29 18:37:40 record count
Previous Message Josh Berkus 2002-08-29 17:52:39 Re: union optimization in views