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 B64AAD1B95D for ; Sat, 15 Nov 2003 20:11:33 +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 76914-10 for ; Sat, 15 Nov 2003 16:11:04 -0400 (AST) Received: from guinness.cs.stevens-tech.edu (guinness.cs.stevens-tech.edu [155.246.89.8]) by svr1.postgresql.org (Postfix) with ESMTP id BC629D1B4E4 for ; Sat, 15 Nov 2003 16:11:02 -0400 (AST) Received: by guinness.cs.stevens-tech.edu (Postfix, from userid 4405) id C09C1143868; Sat, 15 Nov 2003 15:11:04 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by guinness.cs.stevens-tech.edu (Postfix) with ESMTP id B530AC2465; Sat, 15 Nov 2003 15:11:04 -0500 (EST) Date: Sat, 15 Nov 2003 15:11:04 -0500 From: Yasir Malik To: Greg Stark Cc: Guillaume LELARGE , pgsql-sql@postgresql.org Subject: Re: Getting last insert value In-Reply-To: <8765hlmsgr.fsf@stark.dyndns.tv> Message-ID: References: <200311151640.42892.gleu@wanadoo.fr> <8765hlmsgr.fsf@stark.dyndns.tv> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/176 X-Sequence-Number: 15991 Thank you all for your help. Yasir Malik On Sat, 15 Nov 2003, Greg Stark wrote: > Date: 15 Nov 2003 12:50:28 -0500 > From: Greg Stark > To: Guillaume LELARGE > Cc: Yasir Malik , pgsql-sql@postgresql.org > Subject: Re: [SQL] Getting last insert value > > > 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 > > > ---------------------------(end of broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings >