Skip site navigation (1) Skip section navigation (2)

Re: Access - ODBC - serial problem...

From: Shachar Shemesh <psql(at)shemesh(dot)biz>
To: 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 16:44:45
Message-ID: 4075817D.1080106@shemesh.biz (view raw or flat)
Thread:
Lists: pgsql-odbc
Philippe Lang wrote:

>Hello,
>
>I have made some more tests regarding my precedent post "[ODBC] Access - ODBC - index strange bug", and in fact it is not index-related. The bug is just more visible when an index is used, apparently.
>
>The problem comes from the serial identifier, which is not know from the client at the time the record is being inserted.
>
>With the table described below, imagine I do, from the client:
>
>insert into test (code) VALUES (20);
>
>How does the client know the id that has been given to the record? With ethereal, I could see Access fetches the id by doing a 
>
>select id from test where code = 20"
>
>Of course, another record has the same code, and the wrong id is being fetched back. This explains what I have noticed, and that is explained below...
>
>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?

          Shachar

-- 
Shachar Shemesh
Lingnu OpenSource Consulting
http://www.lingnu.com/


In response to

Responses

pgsql-odbc by date

Next:From: Ray AspeitiaDate: 2004-04-08 17:11:36
Subject: Re: Access - ODBC - serial problem...
Previous:From: Richard CombsDate: 2004-04-08 15:21:27
Subject: Re: Access - ODBC - serial problem...

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group