X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id A33509DC942 for ; Fri, 13 Jan 2006 18:48:10 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 06973-06 for ; Fri, 13 Jan 2006 18:48:09 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from vms046pub.verizon.net (vms046pub.verizon.net [206.46.252.46]) by postgresql.org (Postfix) with ESMTP id 2F8DA9DC862 for ; Fri, 13 Jan 2006 18:48:04 -0400 (AST) Received: from osgiliath.mathom.us ([70.108.47.21]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0IT1003IQZC5MHDC@vms046.mailsrvcs.net> for pgsql-performance@postgresql.org; Fri, 13 Jan 2006 16:48:05 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by osgiliath.mathom.us (Postfix) with ESMTP id 45E646061604 for ; Fri, 13 Jan 2006 17:48:04 -0500 (EST) Received: from osgiliath.mathom.us ([127.0.0.1]) by localhost (osgiliath.home.mathom.us [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 14228-01 for ; Fri, 13 Jan 2006 17:48:02 -0500 (EST) Received: by osgiliath.mathom.us (Postfix, from userid 1000) id 917926061601; Fri, 13 Jan 2006 17:48:01 -0500 (EST) Date: Fri, 13 Jan 2006 17:48:01 -0500 From: Michael Stone Subject: Re: insert without oids In-reply-to: <1137187755.2509.6.camel@localhost.localdomain> To: pgsql-performance@postgresql.org Mail-followup-to: pgsql-performance@postgresql.org Message-id: <20060113224800.GJ1408@mathom.us> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-disposition: inline X-Pgp-Fingerprint: 53 FF 38 00 E7 DD 0A 9C 84 52 84 C5 EE DF 7C 88 X-Virus-Scanned: Debian amavisd-new at mathom.us References: <20060113201011.GI1408@mathom.us> <1137187755.2509.6.camel@localhost.localdomain> User-Agent: Mutt/1.5.11 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.105 required=5 tests=[AWL=0.105] X-Spam-Score: 0.105 X-Spam-Level: X-Archive-Number: 200601/169 X-Sequence-Number: 16647 On Fri, Jan 13, 2006 at 04:29:15PM -0500, Neil Conway wrote: >There's really no additional operations required: >INSERT INTO t2 VALUES (currval('t1_id_seq'), ...); >You need a separate SELECT if you want to use the generated sequence >value outside the database, That would, of course, be the goal. IOW, if you have a table which has data which is unique only for the serial column, the old syntax provided a way to refer to the newly inserted row uniquely without any additional operations. >although the INSERT ... RETURNING extension will avoid that That sounds promising. I'll have to put the TODO list on my todo list. :) Mike Stone