Re: Access - ODBC - serial problem...

Поиск
Список
Период
Сортировка
От Shachar Shemesh
Тема Re: Access - ODBC - serial problem...
Дата
Msg-id 4075817D.1080106@shemesh.biz
обсуждение исходный текст
Ответ на Access - ODBC - serial problem...  ("Philippe Lang" <philippe.lang@attiksystem.ch>)
Ответы Re: Access - ODBC - serial problem...  (Richard Huxton <dev@archonet.com>)
Список 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 по дате отправления:

Предыдущее
От: Richard Combs
Дата:
Сообщение: Re: Access - ODBC - serial problem...
Следующее
От: Ray Aspeitia
Дата:
Сообщение: Re: Access - ODBC - serial problem...