Re: [SQL] BEFORE UPDATE Triggers

2003-08-30 Thread Jan Wieck
Chris Anderson wrote: PostgreSQL Version: 7.2.3 Procedural Language: PL/pgSQL I have a table which contains a field for the user who last modified the record. Whenever a row in this table is updated, I want to have an UPDATE trigger do the following things: 1) Ensure the UPDATE query supplied

[SQL] Getting the return type right for SETOF

2003-08-30 Thread Dan Langille
Hi folks, I'm playing with SETOF on functions. But I can't get the return type correct. What have I missed? A cast? CREATE OR REPLACE FUNCTION elementGet (text) RETURNS SETOF element_type AS ' select 1, \'test\', \'F\' \'A\', FALSE, FALSE ' LANGUAGE sq

Re: [SQL] Getting the return type right for SETOF

2003-08-30 Thread Stephan Szabo
On Sat, 30 Aug 2003, Dan Langille wrote: > Hi folks, > > I'm playing with SETOF on functions. But I can't get the return type > correct. What have I missed? A cast? > > CREATE OR REPLACE FUNCTION elementGet (text) RETURNS SETOF > element_type AS ' > > select 1, >\'test\', >\'F\'

Re: [SQL] BEFORE UPDATE Triggers

2003-08-30 Thread Tom Lane
Jan Wieck <[EMAIL PROTECTED]> writes: > Unfortunately, you're right. There is no way do distinguish in a trigger > or rule if a value in the new row did result from the UPDATE query or > from target list expansion with OLD values. > It would not be terribly hard to examine the original query dur