Re: Access - ODBC - serial problem... - Mailing list pgsql-odbc

From Richard Huxton
Subject Re: Access - ODBC - serial problem...
Date
Msg-id 200404081857.38799.dev@archonet.com
Whole thread Raw
In response to Re: Access - ODBC - serial problem...  (Shachar Shemesh <psql@shemesh.biz>)
List pgsql-odbc
On Thursday 08 April 2004 17:44, Shachar Shemesh wrote:
> Philippe Lang wrote:
> >
> >Is there a solution to that, except inserting records with PL-PGSQL, which
> > I already do in some cases, by the way...?
>
> I would love it if one of the resident Postgres gurus could verify this,
> but I think running "select currval('test_id_seq')" ought to do exactly
> what you want in this case. It should tell you the most recent id
> assigned by the sequence in your session.
>
> Can someone please verify that this command does not suffer races?

currval() and nextval() are guaranteed safe. What this does mean is that you
can end up with gaps in your sequence though.

--
  Richard Huxton
  Archonet Ltd

pgsql-odbc by date:

Previous
From: Ray Aspeitia
Date:
Subject: Re: Access - ODBC - serial problem...
Next
From: "Philippe Lang"
Date:
Subject: Re: Access - ODBC - serial problem...