Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id A7DF12E395F for ; Wed, 12 Dec 2007 02:45:13 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 73054-05 for ; Wed, 12 Dec 2007 02:45:09 -0400 (AST) Received: from mail63.csoft.net (leary.csoft.net [205.205.214.5]) by postgresql.org (Postfix) with SMTP id DB0562E3933 for ; Wed, 12 Dec 2007 02:45:10 -0400 (AST) Received: (qmail 23678 invoked by uid 1112); 12 Dec 2007 06:45:09 -0000 Date: Wed, 12 Dec 2007 01:45:09 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Tom Lane cc: Ken Johanson , pgsql-general@postgresql.org Subject: Re: RETURNING clause: how to specifiy column indexes? In-Reply-To: <12796.1197439644@sss.pgh.pa.us> Message-ID: References: <22a9f7570703301215y44a937d0r5faa706bad7948c@mail.gmail.com> <4610AA0C.30608@ejurka.com> <47579D44.6060005@kensystem.com> <47579FBE.1070503@kensystem.com> <475F7766.2040005@kensystem.com> <12796.1197439644@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/704 X-Sequence-Number: 125447 On Wed, 12 Dec 2007, Tom Lane wrote: > Every few weeks we get a complaint from someone who thinks that it > should be easy to rearrange the logical order of table columns. > If that comes to pass, it would be a seriously bad idea to have > encouraged applications to rely on table column numbers. I think the expectation is that: CREATE TABLE t(a int, b int); INSERT INTO t(b,a) VALUES (1,2) RETURNING *; will return 1,2 instead of 2,1 as it does now. In this case the op is not expecting that the (potentially reorganized) table order is driving the results, but the order that they've actually specified the columns in creates the result. Kris Jurka