Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 7BF5D2E2F8E for ; Wed, 12 Dec 2007 03:01:08 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 96001-04 for ; Wed, 12 Dec 2007 03:01:03 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 385242E00FE for ; Wed, 12 Dec 2007 03:01:05 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id lBC713SK013401; Wed, 12 Dec 2007 02:01:03 -0500 (EST) To: Kris Jurka cc: Ken Johanson , pgsql-general@postgresql.org Subject: Re: RETURNING clause: how to specifiy column indexes? In-reply-to: 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> Comments: In-reply-to Kris Jurka message dated "Wed, 12 Dec 2007 01:45:09 -0500" Date: Wed, 12 Dec 2007 02:01:03 -0500 Message-ID: <13400.1197442863@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/706 X-Sequence-Number: 125449 Kris Jurka writes: > 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. Hmm ... I see your point, but on what grounds could one argue that a "*" targetlist here should return something different from what "SELECT * FROM t" would return? I'd say that an app that wants that should write INSERT INTO t(b,a) VALUES (1,2) RETURNING b,a; which is surely not that hard if you've got the code to produce the "(b,a)" part. In any case it's not clear this is the same thing Ken is complaining about ... regards, tom lane