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

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: [SQL] Unable to use INSERT ... RETURNING with column from other table
Дата
Msg-id CAH2-Wz=egG5KCku7h4AHMYiLv_ht4b5D7o=GVaHRof54Eop+MA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [SQL] Unable to use INSERT ... RETURNING with column fromother table  (Andreas Joseph Krogh <andreas@visena.com>)
Ответы Re: [SQL] Unable to use INSERT ... RETURNING with column from other table  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: [SQL] Unable to use INSERT ... RETURNING with column from other table
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [SQL] Unable to use INSERT ... RETURNING with column from other table