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