pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Ken Johanson <pg-user@kensystem.com>
Cc: pgsql-general@postgresql.org
Subject: Re: RETURNING clause: how to specifiy column indexes?
Date: Wed, 12 Dec 2007 01:45:09 -0500 (EST)
Message-ID: <Pine.BSO.4.64.0712120138360.1768@leary.csoft.net> (raw)
In-Reply-To: <12796.1197439644@sss.pgh.pa.us>
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>



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




view thread (11+ messages)  latest in thread

Message-ID: <Pine.BSO.4.64.0712120138360.1768@leary.csoft.net>
Permalink:  ../Pine.BSO.4.64.0712120138360.1768@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.64.0712120138360.1768@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, tgl@sss.pgh.pa.us, pg-user@kensystem.com, pgsql-general@postgresql.org
  Subject: Re: RETURNING clause: how to specifiy column indexes?
  In-Reply-To: <Pine.BSO.4.64.0712120138360.1768@leary.csoft.net>
  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> <Pine.BSO.4.64.0712120138360.1768@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox