pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kris Jurka <books@ejurka.com>
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 02:01:03 -0500
Message-ID: <13400.1197442863@sss.pgh.pa.us> (raw)
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>

Kris Jurka <books@ejurka.com> 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



view thread (11+ messages)  latest in thread

Message-ID: <13400.1197442863@sss.pgh.pa.us>
Permalink:  ../13400.1197442863@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13400.1197442863@sss.pgh.pa.us

 · 

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

* 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