X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 9AE3DD1C951 for ; Sat, 15 Nov 2003 20:54:44 +0000 (GMT) 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 86388-07 for ; Sat, 15 Nov 2003 16:54:15 -0400 (AST) Received: from web41007.mail.yahoo.com (web41007.mail.yahoo.com [66.218.93.6]) by svr1.postgresql.org (Postfix) with SMTP id 326EED1B4E8 for ; Sat, 15 Nov 2003 16:54:02 -0400 (AST) Message-ID: <20031115205403.54792.qmail@web41007.mail.yahoo.com> Received: from [66.108.25.20] by web41007.mail.yahoo.com via HTTP; Sat, 15 Nov 2003 12:54:03 PST Date: Sat, 15 Nov 2003 12:54:03 -0800 (PST) From: Theodore Petrosky Subject: Re: Getting last insert value To: Yasir Malik , pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/177 X-Sequence-Number: 15992 what does that mean the 'last row'? if client 1 inserts then client 2, the last row is client 2. do you want to know what row client 1 inserted? Personally I think your question is too broad. What are you trying to accomplish? Ted --- Yasir Malik wrote: > Hello, > I have a table with many fields, and one of the > fields is of type serial. > I will do many inserts, and there will be many > repeats of the other fields > in the table, but, obviously, the serial field will > be unique for all the > rows. How can I get the value of serial field of > the last row I inserted. > I know I can select the maximum value from the > serial field, but is there > a better way, preferably something that takes > constant time. > Thanks, > Yasir Malik > > ---------------------------(end of > broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org __________________________________ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree