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 2E341D1B4E8 for ; Sat, 15 Nov 2003 17:51:05 +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 65992-07 for ; Sat, 15 Nov 2003 13:50:34 -0400 (AST) Received: from smtp.istop.com (dci.doncaster.on.ca [66.11.168.194]) by svr1.postgresql.org (Postfix) with ESMTP id CC91BD1B50C for ; Sat, 15 Nov 2003 13:50:32 -0400 (AST) Received: from stark.dyndns.tv (gsstark.mtl.istop.com [66.11.160.162]) by smtp.istop.com (Postfix) with ESMTP id E3A9A36D99; Sat, 15 Nov 2003 12:50:28 -0500 (EST) Received: from localhost ([127.0.0.1] helo=stark.dyndns.tv ident=foobar) by stark.dyndns.tv with smtp (Exim 3.36 #1 (Debian)) id 1AL4Z2-0004ym-00; Sat, 15 Nov 2003 12:50:28 -0500 To: Guillaume LELARGE Cc: Yasir Malik , pgsql-sql@postgresql.org Subject: Re: Getting last insert value References: <200311151640.42892.gleu@wanadoo.fr> In-Reply-To: <200311151640.42892.gleu@wanadoo.fr> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 15 Nov 2003 12:50:28 -0500 Message-ID: <8765hlmsgr.fsf@stark.dyndns.tv> Lines: 12 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/171 X-Sequence-Number: 15986 Guillaume LELARGE writes: > Doing a "select currval() from my_table" after your insert should work. That's "select currval('my_table_pkcol_seq')" actually. The above would have called the currval() function for every record of the table which isn't what you want and in any case currval takes an argument. -- greg