Re: Getting Primary Key Value After Insert

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Adam <adam(at)spatialsystems(dot)org>, Postgres general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: Getting Primary Key Value After Insert
Date: 2006-07-09 06:02:26
Message-ID: 20060709060226.25396.qmail@web31802.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> > > 3. If you call currval() will it return 20? I would think it does.
>
> Yes it does.
>
> > My understanding is that it will provided your are within a transaction.
>
> As long as you're in the same session you're fine. You would have to go out of
> your way to break it but if you're using some sort of connection pooling you
> wouldn't want to pull a fresh connection from the pool, for example.

Just to clarify, currval() is isolated by the session on not necessarily by a transaction?

Regards,

Richard Broersma Jr.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Carlos H. Reimer 2006-07-09 11:16:37 Mobile servers replication
Previous Message Greg Stark 2006-07-09 05:45:48 Re: Getting Primary Key Value After Insert