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

From Shachar Shemesh
Subject Re: Access - ODBC - serial problem...
Date
Msg-id 4075817D.1080106@shemesh.biz
Whole thread Raw
In response to Access - ODBC - serial problem...  ("Philippe Lang" <philippe.lang@attiksystem.ch>)
Responses Re: Access - ODBC - serial problem...
List 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
notindex-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
doinga  
>
>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/


pgsql-odbc by date:

Previous
From: Richard Combs
Date:
Subject: Re: Access - ODBC - serial problem...
Next
From: Ray Aspeitia
Date:
Subject: Re: Access - ODBC - serial problem...