Re: Bug in PL/pgSQL GET DIAGNOSTICS? - Mailing list pgsql-hackers

From Michael Paesold
Subject Re: Bug in PL/pgSQL GET DIAGNOSTICS?
Date
Msg-id 013501c2742a$80549330$4201a8c0@beeblebrox
Whole thread Raw
In response to Re: PGXLOG variable worthwhile?  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> wrote:

> "Michael Paesold" <mpaesold@gmx.at> writes:
> > In a PL/pgSQL function I want to insert into a table and get the OID
back.
> > That usually works with
> > GET DIAGNOSTICS last_oid = RESULT_OID;
> > right after the insert statement.
>
> > But if the table that I insert to has a rule (or perhaps a trigger?)
that
> > updates another table, the RESULT_OID after the insert will be 0 (zero).
>
> As of CVS tip, this example produces the results I believe you want:
>
> regression=# SELECT pltestfunc(10);
> NOTICE:  RESULT_OID: 282229
> NOTICE:  RESULT_OID: 282230
> NOTICE:  RESULT_OID: 282231
...
[snip]

That is very good news. I appreciate that you got it fixed for 7.3. I am
sure I am only one of many who have use for that, but thanks anyway!

Best Regards,
Michael Paesold



pgsql-hackers by date:

Previous
From: Daniel Kalchev
Date:
Subject: DROP USER weirdness in 7.2.1
Next
From: Justin Clift
Date:
Subject: French version of the PostgreSQL "Advocacy and Marketing" site is ready