Re: @@IDENTITY (Was: Access - ODBC - serial problem) - Mailing list pgsql-odbc

From Tom Lane
Subject Re: @@IDENTITY (Was: Access - ODBC - serial problem)
Date
Msg-id 11775.1081790876@sss.pgh.pa.us
Whole thread Raw
In response to Re: @@IDENTITY (Was: Access - ODBC - serial problem)  ("scott.marlowe" <scott.marlowe@ihs.com>)
Responses LOG: unexpected EOF on client connection
List pgsql-odbc
"scott.marlowe" <scott.marlowe@ihs.com> writes:
> [ use ORDER BY ... LIMIT instead of MAX ]

> However, I think you have to be in serializable transaction mode for that
> code to be gauranteed not to get the wrong data.  But I'm not certain on
> that one.

Yes, you need serializable mode with *either* method to ensure you see
your own row, and not one inserted later by another transaction that
managed to commit before you.  The ORDER BY trick is just to get around
Postgres' inability to connect MAX() to indexes; it doesn't affect the
transactional semantics at all.

            regards, tom lane

pgsql-odbc by date:

Previous
From: "scott.marlowe"
Date:
Subject: Re: @@IDENTITY (Was: Access - ODBC - serial problem)
Next
From: Chris Gamache
Date:
Subject: LOG: unexpected EOF on client connection