Re: cannot use result of (insert..returning)

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: cannot use result of (insert..returning)
Дата
Msg-id 200806121809.m5CI99J11694@momjian.us
обсуждение исходный текст
Ответ на Re: cannot use result of (insert..returning)  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
Andrew Dunstan wrote:
> >>> I need to use query like:
> >>>    select (insert into test (a) values (x) returning b),c from anytable 
> >>> where condition
> >>> but it say
> >>>    ERROR: syntax error at or near "into"
> >>>
> >>> Is this a bug?
> >>>       
> >> No, it's a known limitation.
> >>     
> >
> > Is there a TODO item for this?  I don't see one, do you?
> >
> >   
> Allow INSERT/UPDATE ... RETURNING inside a SELECT 'FROM' clause
> 
> http://archives.postgresql.org/pgsql-general/2006-09/msg00803.php
> http://archives.postgresql.org/pgsql-hackers/2006-10/msg00693.php

Yes, but the TODO item talks about its use in the FROM clause, while the
failed query is using it in the target list.

Updated TODO with new URL is:

* Allow INSERT/UPDATE ... RETURNING inside a SELECT 'FROM' clause or target list
 http://archives.postgresql.org/pgsql-general/2006-09/msg00803.php
http://archives.postgresql.org/pgsql-hackers/2006-10/msg00693.php
http://archives.postgresql.org/pgsql-hackers/2008-06/msg00124.php


--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Proposal - improve eqsel estimates by including histogram bucket numdistinct statistics
Следующее
От: Neil Conway
Дата:
Сообщение: Re: .psqlrc output for \pset commands