Re: Missing table from in INSERT RETURNING

From: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Missing table from in INSERT RETURNING
Date: 2015-02-17 20:15:17
Message-ID: CAKFQuwbkrw3k3LSmPH8-GqmpdJuqR8057NC-b190eF42w0-EfA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Feb 17, 2015 at 1:08 PM, John McKown [via PostgreSQL] <
ml-node+s1045698n5838306h10(at)n5(dot)nabble(dot)com> wrote:

> I haven't seen any one else reply. I don't know if you've gotten a
> solution. But the following seemed to work for me:
>
>
​mine apparently got bounced...​

> WITH serie AS (
> select s, s*10 as computing
> from generate_series(1,10) as s
> )
> INSERT INTO test_insert_returning (some_value)
> SELECT computing
> FROM serie
> RETURNING gid, some_value;
>

​or, "RETURNING some_value / 10"​

> From my reading on the RETURNING phrase, you can only return values from
> the table into which you are doing the INSERT. Not any other table or view
> which might be referenced.
>
>
​This is correct; and I am curious on the use case that requires otherwise.​

​David J.​

--
View this message in context: http://postgresql.nabble.com/Missing-table-from-in-INSERT-RETURNING-tp5838274p5838309.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John McKown 2015-02-17 20:33:12 Re: Missing table from in INSERT RETURNING
Previous Message John McKown 2015-02-17 20:14:03 Re: Missing table from in INSERT RETURNING