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 4E17DD1DAB9 for ; Mon, 12 Apr 2004 14:28:08 -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 90660-08 for ; Mon, 12 Apr 2004 14:28:06 -0300 (ADT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 75083D1D9CB for ; Mon, 12 Apr 2004 14:28:05 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i3CHRuX8011776; Mon, 12 Apr 2004 13:27:56 -0400 (EDT) To: "scott.marlowe" Cc: Ed Brown , Philippe Lang , pgsql-odbc@postgresql.org Subject: Re: @@IDENTITY (Was: Access - ODBC - serial problem) In-reply-to: References: Comments: In-reply-to "scott.marlowe" message dated "Mon, 12 Apr 2004 10:44:37 -0600" Date: Mon, 12 Apr 2004 13:27:56 -0400 Message-ID: <11775.1081790876@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/88 X-Sequence-Number: 3983 "scott.marlowe" 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