Skip site navigation (1) Skip section navigation (2)

Re: [NOVICE] Last ID Problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [NOVICE] Last ID Problem
Date: 2005-02-02 21:04:27
Message-ID: 6531.1107378267@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Greg Stark <gsstark(at)mit(dot)edu> writes:
> This is from the DBI documentation -- that is, the non-driver-specific
> abstract interface documentation.

>            Returns a value 'identifying' the row just inserted, if possible.
>            Typically this would be a value assigned by the database server to
>            a column with an auto_increment or serial type.

Aside from the numerous serious problems pointed out in the
documentation, this has an even more fatal objection, which is that it's
unspecified what the result value is and thus there is no portable way
of *using* the result after you have it.  (If the PG driver returns an
OID you certainly couldn't use that the same way as some other driver
that returns a primary key ... especially a multicolumn primary key ...)

This "portable" function is so unportable that I see no reason to
accept it as precedent.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: G u i d o B a r o s i oDate: 2005-02-02 21:18:40
Subject: fatal: cache id 30 (or alike)
Previous:From: Oliver JowettDate: 2005-02-02 20:45:02
Subject: Re: [NOVICE] Last ID Problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group