Re: INSERT... WHERE - Mailing list pgsql-general

From Robert James
Subject Re: INSERT... WHERE
Date
Msg-id CAGYyBgj4S1r9QP6yJ-8rGQBP+icTGfHauoAVP-QWTJNxWn5QSg@mail.gmail.com
Whole thread Raw
In response to Re: INSERT... WHERE  (Chris Angelico <rosuav@gmail.com>)
Responses Re: INSERT... WHERE  (Chris Angelico <rosuav@gmail.com>)
Re: INSERT... WHERE  (David Johnston <polobo@yahoo.com>)
List pgsql-general
On 1/13/13, Chris Angelico <rosuav@gmail.com> wrote:
> On Mon, Jan 14, 2013 at 3:37 PM, Robert James <srobertjames@gmail.com>
> wrote:
>> Thanks.  But how do I do that where I have many literals? Something like:
>>
>> INSERT INTO seltest (id, a, b) SELECT (1,2,3),(4,5,6),(7,8,9) WHERE b
>> IN (SELECT ...)
>
> You can use WITH clauses in crazy ways with PostgreSQL. I haven't
> actually tried it, but you should be able to put your VALUES behind a
> WITH, then SELECT from that WHERE blah blah, and INSERT that SELECT.
>
> As they say, knock yourself out! :)
>
> ChrisA


I don't quite follow - could you please elaborate?


pgsql-general by date:

Previous
From: Brian Sutherland
Date:
Subject: Re: plpython intermittent ImportErrors
Next
From: Tom Lane
Date:
Subject: Re: lock and socket file