X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 6F5B9D1D8B7 for ; Thu, 8 Apr 2004 14:58:30 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 40791-02 for ; Thu, 8 Apr 2004 14:57:44 -0300 (ADT) Received: from anchor-post-33.mail.demon.net (anchor-post-33.mail.demon.net [194.217.242.91]) by svr1.postgresql.org (Postfix) with ESMTP id 46E31D1D299 for ; Thu, 8 Apr 2004 14:57:43 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-33.mail.demon.net with esmtp (Exim 3.35 #1) id 1BBdmY-000HqH-0X; Thu, 08 Apr 2004 18:57:43 +0100 Received: by mainbox.archonet.com (Postfix, from userid 529) id 800051644B; Thu, 8 Apr 2004 18:57:41 +0100 (BST) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 8097D16448; Thu, 8 Apr 2004 18:57:39 +0100 (BST) From: Richard Huxton To: Shachar Shemesh , Philippe Lang Subject: Re: Access - ODBC - serial problem... Date: Thu, 8 Apr 2004 18:57:38 +0100 User-Agent: KMail/1.5 Cc: pgsql-odbc@postgresql.org References: <6C0CF58A187DA5479245E0830AF84F420802A0@poweredge.attiksystem.ch> <4075817D.1080106@shemesh.biz> In-Reply-To: <4075817D.1080106@shemesh.biz> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200404081857.38799.dev@archonet.com> X-Bogosity: No, tests=bogofilter, spamicity=0.000000, version=0.15.3 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/66 X-Sequence-Number: 3961 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