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

From Martijn van Oosterhout
Subject Re: selects possible in VALUES() claueses?
Date
Msg-id 20030303040458.GA21430@svana.org
Whole thread Raw
In response to selects possible in VALUES() claueses?  (Dennis Gearon <gearond@cvc.net>)
Responses Re: selects possible in VALUES() claueses?
List pgsql-general
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. However, SELECT will work,
like so:

> INSERT INTO Usrs(
>   first_name,
>   middle_name,
>   sur_name,
>   sur_name_extra,
>   gen_id,
>   login
> )

SELECT

>   'Dennis'::text,
>   'Keith'::text,
>   'Gearon'::text,
>   'none'::text,
>   (SELECT gen_id FROM Gens WHERE gen = 'none'::varchar),
>   'dude'::varchar
;

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Support bacteria! They're the only culture some people have.

Attachment

pgsql-general by date:

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