X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 732403102F4 for ; Fri, 27 Jun 2003 17:09:38 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 10445-08 for ; Fri, 27 Jun 2003 14:09:28 -0300 (ADT) Received: from mail.4dmatrix.com (mail.4dmatrix.com [208.248.151.248]) by svr1.postgresql.org (Postfix) with ESMTP id 73A7E3102EE for ; Fri, 27 Jun 2003 14:09:25 -0300 (ADT) Received: from joshdesk2 (sonicwall.4dmatrix.com [208.248.151.201] (may be forged)) by mail.4dmatrix.com (8.9.3/8.9.3) with SMTP id KAA18637; Fri, 27 Jun 2003 10:01:25 -0700 Message-ID: <02a101c33cce$7af916a0$6e02a8c0@4dmatrix.com> From: "Josh Goldberg" To: "Bruno Wolff III" Cc: "Michael Kovalcik" , References: <20030623184706.75021.qmail@web11101.mail.yahoo.com> <01f401c33c25$fbffd5d0$6e02a8c0@4dmatrix.com> <20030626233001.GA11420@wolff.to> Subject: Re: How do I select the last Id in a column??? Date: Fri, 27 Jun 2003 10:06:41 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Archive-Number: 200306/323 X-Sequence-Number: 9314 What could cause a table to act serialized when read committed transactions are set in the configuration? That is something I am running into, which provoked my [incorrect] example. From: "Bruno Wolff III" Sent: Thursday, June 26, 2003 4:30 PM > On Thu, Jun 26, 2003 at 14:00:33 -0700, > Josh Goldberg wrote: > > to get the last record inserted just > > select * from row order by autoincId desc limit 1; > > > > if you have several clients doing this you might want to put your insert and > > the select inside a transaction. > > That won't help. Your suggestion will only work in serializable transactions. > > In read committed mode the select might see a value for autoincId from > a transaction that committed between the insert and the select. > > ---------------------------(end of broadcast)--------------------------- > TIP 8: explain analyze is your friend >