pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Shachar Shemesh <psql@shemesh.biz>
To: Philippe Lang <philippe.lang@attiksystem.ch>
Cc: pgsql-odbc@postgresql.org
Subject: Re: Access - ODBC - serial problem...
Date: Thu, 8 Apr 2004 18:57:38 +0100
Message-ID: <200404081857.38799.dev@archonet.com> (raw)
In-Reply-To: <4075817D.1080106@shemesh.biz>
References: <6C0CF58A187DA5479245E0830AF84F420802A0@poweredge.attiksystem.ch>
	<4075817D.1080106@shemesh.biz>

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



view thread (12+ messages)  latest in thread

Message-ID: <200404081857.38799.dev@archonet.com>
Permalink:  ../200404081857.38799.dev@archonet.com/
Also on:    postgresql.org/message-id/200404081857.38799.dev@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: dev@archonet.com, psql@shemesh.biz, philippe.lang@attiksystem.ch
  Subject: Re: Access - ODBC - serial problem...
  In-Reply-To: <200404081857.38799.dev@archonet.com>
  References: <6C0CF58A187DA5479245E0830AF84F420802A0@poweredge.attiksystem.ch> <4075817D.1080106@shemesh.biz> <200404081857.38799.dev@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox