Re: Use select and update together

From: pasman pasmański <pasman(dot)p(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Use select and update together
Date: 2011-09-13 05:50:10
Message-ID: CAOWY8=bpkoexYaoqGJf42Fo4Zprj6TwmV6OukKvQkJSEg=Gqxw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

In 8.4 this syntax is not implemented.

2011/9/12, Boris <kuzikoff(at)ukr(dot)net>:
> Hi, this is my first on this list.
>
> I can't understand where my problem in PG 8.4.
>
> CREATE TABLE tbl( KEY int, val int);
>
> Update query like:
>
> UPDATE tbl SET val = 1
> WHERE KEY = any('{0,1,2,3,4,5}'::int[])
> returning key;
>
> work well. But any try to wrap it in select query like:
>
> SELECT (
> UPDATE tbl SET val = 1
> WHERE KEY = any('{0,1,2,3,4,5}'::int[])
> returning key
> );
>
> cause syntax error. Is any query of such type (update warped into
> select) is possible?
>
>
> Best regards, Kuzikov Borys
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>

--
------------
pasman

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Samuel Gendler 2011-09-13 06:45:11 Re: Use select and update together
Previous Message Boris 2011-09-12 10:36:12 Use select and update together