Re: Unable to use INSERT ... RETURNING with column from other table

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Andreas Joseph Krogh <andreas(at)visena(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Unable to use INSERT ... RETURNING with column from other table
Date: 2017-10-25 02:45:13
Message-ID: CAH2-Wz=egG5KCku7h4AHMYiLv_ht4b5D7o=GVaHRof54Eop+MA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, Oct 24, 2017 at 3:49 PM, Andreas Joseph Krogh
<andreas(at)visena(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2017-10-25 03:04:44 Re: Unable to use INSERT ... RETURNING with column from other table
Previous Message David G. Johnston 2017-10-25 01:56:02 Re: Unable to use INSERT ... RETURNING with column from other table