Re: Retrieving PK of inserted row - Mailing list pgsql-general

From cedric
Subject Re: Retrieving PK of inserted row
Date
Msg-id 200701301230.05767.cedric@over-blog.com
Whole thread Raw
In response to Retrieving PK of inserted row  ("woger151" <woger151@jqpx37.cotse.net>)
List pgsql-general
Le mardi 30 janvier 2007 12:19, woger151 a écrit :
> (3) Use LASTVAL
for this one : look at
http://people.planetpostgresql.org/xzilla/index.php?/archives/169-Is-lastval-evil.html
>
> My questions:
> * Are any of these methods flawed?
> * Is there any reason to prefer (1) to (2)?
> * I'm not sure whether LASTVAL is guaranteed to work outside of a
> transaction.  Its description in the 8.1 manual starts with "Return the
> value most recently returned by nextval in the current session. ..." but
> I'm not sure of the formal sense in which "session" is being used.  (I'm
> connecting to the DB from mod_php in apache, so I guess "session" could
> mean "during the existence of a given db connection," but I'm not sure.)

pgsql-general by date:

Previous
From: "Willy-Bas Loos"
Date:
Subject: Re: Unauthorized users can see db schema and read functions
Next
From: Florian Weimer
Date:
Subject: Foreign keys, table inheritance, and TRUNCATE