Re: RETURNING clause: how to specifiy column indexes? - Mailing list pgsql-general

From Kris Jurka
Subject Re: RETURNING clause: how to specifiy column indexes?
Date
Msg-id Pine.BSO.4.64.0712120138360.1768@leary.csoft.net
Whole thread Raw
In response to Re: RETURNING clause: how to specifiy column indexes?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: RETURNING clause: how to specifiy column indexes?
Re: RETURNING clause: how to specifiy column indexes?
List pgsql-general

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


pgsql-general by date:

Previous
From: "Trevor Talbot"
Date:
Subject: Re: Hijack!
Next
From: luca.ciciriello@email.it
Date:
Subject: Re: POSIX and libpq