Re: [SQL] Unable to use INSERT ... RETURNING with column from other table - Mailing list pgsql-sql

From Peter Geoghegan
Subject Re: [SQL] Unable to use INSERT ... RETURNING with column from other table
Date
Msg-id CAH2-Wz=egG5KCku7h4AHMYiLv_ht4b5D7o=GVaHRof54Eop+MA@mail.gmail.com
Whole thread Raw
In response to Re: [SQL] Unable to use INSERT ... RETURNING with column fromother table  (Andreas Joseph Krogh <andreas@visena.com>)
Responses Re: [SQL] Unable to use INSERT ... RETURNING with column from other table  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
On Tue, Oct 24, 2017 at 3:49 PM, Andreas Joseph Krogh
<andreas@visena.com> wrote:
> I'm not sure how an alias for the target_table will help me here as I'm trying to return a value not being inserted?
> f.id is not inserted, only columns matching f.id.

I must have had my wires crossed.

As David says, you could use multiple CTEs for this.

-- 
Peter Geoghegan


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

pgsql-sql by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: [SQL] Unable to use INSERT ... RETURNING with column from other table
Next
From: Tom Lane
Date:
Subject: Re: [SQL] Unable to use INSERT ... RETURNING with column from other table