Re: selects possible in VALUES() claueses?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Dennis Gearon <gearond(at)cvc(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: selects possible in VALUES() claueses?
Date: 2003-03-03 04:44:57
Message-ID: 389.1046666697@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> On Sun, Mar 02, 2003 at 07:05:15PM -0800, Dennis Gearon wrote:
>> Is it possible to do this?

> No. VALUES only works with real plain values.

Really?

regression=# create table foo (f1 text, f2 int);
CREATE TABLE
regression=# insert into foo values ('abc', (select max(unique1) from tenk1));
INSERT 291603 1
regression=# select * from foo;
f1 | f2
-----+------
abc | 9999
(1 row)

But INSERT ... SELECT is just as good a solution, if not better.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dennis Gearon 2003-03-03 04:47:11 Re: selects possible in VALUES() claueses?
Previous Message Dennis Gearon 2003-03-03 04:35:40 Re: selects possible in VALUES() claueses?