Re: Access - ODBC - serial problem...

From: Richard Huxton <dev(at)archonet(dot)com>
To: Shachar Shemesh <psql(at)shemesh(dot)biz>, Philippe Lang <philippe(dot)lang(at)attiksystem(dot)ch>
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: Access - ODBC - serial problem...
Date: 2004-04-08 17:57:38
Message-ID: 200404081857.38799.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message Philippe Lang 2004-04-08 18:15:20 Re: Access - ODBC - serial problem...
Previous Message Ray Aspeitia 2004-04-08 17:11:36 Re: Access - ODBC - serial problem...