Re: [SQL] PL/pgSQL question

2008-02-14 Thread Milen A. Radev
Sebastian Ritter написа: Hi all, I have a question regarding functions. How can I return zero rows from a function whose return type is a table row? I did the following test and it did not work as expected: [...] CREATE OR REPLACE FUNCTION foobar(boolean) RETURNS SETOF x AS $_$ DECLARE

Re: [SQL] PL/pgSQL question

2003-02-02 Thread Josh Berkus
Jim, > Yes i'm aware this it is possible in 7.3 - can someone please confirm its > not possible in 7.2 or provide me with an example of how to go about it. It is sort of possible in 7.2, as a function can return a cursor to an interface language capable of handling cursors. However, implementa

Re: [SQL] pl/pgsql question

2002-12-18 Thread Tim Perdue
Josh Berkus wrote: Tim, That loop apparently does not find any matching rows, which would have been inserted just before this row was, inside the same transaction. It was successfully finding those rows before, when the trigger was AFTER INSERT. If I manually select those rows after the query

Re: [SQL] pl/pgsql question

2002-12-18 Thread Josh Berkus
Tim, > That loop apparently does not find any matching rows, which would > have been inserted just before this row was, inside the same > transaction. > > It was successfully finding those rows before, when the trigger was > AFTER INSERT. If I manually select those rows after the query is > commi

Re: [SQL] pl/pgsql question

2002-12-18 Thread Tim Perdue
Ludwig Lim wrote: Try changing the "AFTER" to "BEFORE" CREATE TRIGGER projtask_insert_depend_trig BEFORE... Changes made to the "NEW" will not be reflect in the AFTER trigger since, the row is already inserted. Thanks, however this seems to present a different problem now. FOR depe

Re: [SQL] pl/pgsql question

2002-12-17 Thread Ludwig Lim
--- Tim Perdue <[EMAIL PROTECTED]> wrote: > I have created a function in pl/pgsql to modify a > row before it gets put > into the database, but it seems my modification is > being ignored, and > the unmodified row is being inserted. > > I have confirmed with this RAISE EXCEPTION that my > "NEW"

Re: [SQL] pl/pgsql question

2002-12-17 Thread Tom Lane
Tim Perdue <[EMAIL PROTECTED]> writes: > I have created a function in pl/pgsql to modify a row before it gets put ^^^ > into the database, but it seems my modification is being ignored, and > the unmodified row is being inserted. > CREAT