Re: [PHP] Re: Getting last record ID created from DB
- From: markw@xxxxxxxxxxxxxx (Mark)
- Date: Wed, 21 Mar 2007 10:41:31 -0400
Richard Lynch wrote:
On Mon, March 19, 2007 10:58 pm, markw@xxxxxxxxxxxxxx wrote:
markw@xxxxxxxxxxxxxx wrote:
Check the documentation - currval returns the last one *for thatmarkw@xxxxxxxxxxxxxx wrote:
On Sat, 2007-03-17 at 12:19 -0400, Mark wrote:
session* - it does not return the last global change.
http://www.postgresql.org/docs/current/static/functions-sequence.html
It is perfectly safe to use this.
In theory that may be true, but can the application developer make any
assumption about the underlying architecture? Might you be familiar
with
connection pooling? Where multiple threads or processes share a
database
connection or "session?"
If the pool breaks the documentation about current session, the pool
is broken.
Fix it.
:-)
I don't think the "pool" will give you somebody else's ID, for the
record. It's smart enough to not do that, I *believe*, mostly on
faith.
I've seen some pretty disturbing behavior in some Oracle connection pooling
software. The problem is that you don't know it is the connection pool
causing the problem until you chase it down.
.
- References:
- Getting last record ID created from DB
- From: "Jeff"
- Re: [PHP] Getting last record ID created from DB
- From: Philip Thompson
- Re: Getting last record ID created from DB
- From: Colin Guthrie
- Re: [PHP] Re: Getting last record ID created from DB
- From: Myron Turner
- Re: [PHP] Re: Getting last record ID created from DB
- From: Robert Cummings
- Re: [PHP] Re: Getting last record ID created from DB
- From: Mark
- Re: [PHP] Re: Getting last record ID created from DB
- From: Robert Cummings
- Re: [PHP] Re: Getting last record ID created from DB
- From: markw
- Re: [PHP] Re: Getting last record ID created from DB
- From: Jim Lucas
- Re: [PHP] Re: Getting last record ID created from DB
- From: markw
- Re: [PHP] Re: Getting last record ID created from DB
- From: Chris
- Re: [PHP] Re: Getting last record ID created from DB
- From: markw
- Re: [PHP] Re: Getting last record ID created from DB
- From: "Richard Lynch"
- Getting last record ID created from DB
- Prev by Date: Re: [PHP] Re: [GENERAL] phpPgAdmin - prior version available?
- Next by Date: Re: [PHP] Re: Getting last record ID created from DB
- Previous by thread: Re: [PHP] Re: Getting last record ID created from DB
- Next by thread: Re: [PHP] Re: Getting last record ID created from DB
- Index(es):