OIDs seem to be on their way out, and most of the time you can get a
more helpful result by using a serial primary key anyway, but I wonder
if there's any extension to INSERT to help identify what unique id a
newly-inserted key will get? Using OIDs the insert would return the OID
of the inserted
On Fri, Jan 13, 2006 at 03:10:11PM -0500, Michael Stone wrote:
Are there plans on updating the insert API for the post-OID world?
Are you looking for this TODO item?
* Allow INSERT/UPDATE ... RETURNING new.col or old.col
This is useful for returning the auto-generated key for an INSERT.
On Fri, 2006-01-13 at 15:10 -0500, Michael Stone wrote:
OIDs seem to be on their way out, and most of the time you can get a
more helpful result by using a serial primary key anyway, but I wonder
if there's any extension to INSERT to help identify what unique id a
newly-inserted key will get?
On Fri, Jan 13, 2006 at 04:29:15PM -0500, Neil Conway wrote:
There's really no additional operations required:
INSERT INTO t2 VALUES (currval('t1_id_seq'), ...);
You need a separate SELECT if you want to use the generated sequence
value outside the database,
That would, of course, be the