Can't SELECT from (INSERT ... RETURNING)

From: Nico Sabbi <nsabbi(at)officinedigitali(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: Can't SELECT from (INSERT ... RETURNING)
Date: 2007-07-18 14:06:38
Message-ID: 469E1E6E.3050404@officinedigitali.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I thought I could use the output of INSERT...RETURNING as a set of
tuples for a subquery,
but it seems it's not the case:

nb1=# select * from (insert into m(a) values(112) returning a);
ERROR: syntax error at or near "into"
LINE 1: select * from (insert into m(a) values(112) returni...
^

Is this a bug or it's not even supposed to work in theory?
Such a feature would be extremely useful to have.

P.S.
I know it's non-portable, but this is not a problem.

Thanks,

Nico

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Fetter 2007-07-18 15:33:25 Re: REQUEST: option to auto-generate new sequences with CREATE TABLE (LIKE)
Previous Message Nico Sabbi 2007-07-18 13:10:30 REQUEST: option to auto-generate new sequences with CREATE TABLE (LIKE)