Bruce Cota <[EMAIL PROTECTED]> writes: > Is there a way, in SQL, to access the oid of the row created > by an immediately preceding insert statement?
If you are writing a psql script, recent psql versions maintain a LASTOID variable: regression=# insert into int4_tbl default values; INSERT 3357467 1 regression=# select :LASTOID; ?column? ---------- 3357467 (1 row) regression=# regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]