Re: selects possible in VALUES() claueses? - Mailing list pgsql-general

From Tom Lane
Subject Re: selects possible in VALUES() claueses?
Date
Msg-id 389.1046666697@sss.pgh.pa.us
Whole thread Raw
In response to Re: selects possible in VALUES() claueses?  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Martijn van Oosterhout <kleptog@svana.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

pgsql-general by date:

Previous
From: Dennis Gearon
Date:
Subject: Re: selects possible in VALUES() claueses?
Next
From: Dennis Gearon
Date:
Subject: Re: selects possible in VALUES() claueses?