Re: update returning order by syntax error question
| От | Luca Ferrari |
|---|---|
| Тема | Re: update returning order by syntax error question |
| Дата | |
| Msg-id | CAKoxK+7DO65FaZ84DYon9tWjPxGhruhOfcLx127=8ifn_KhSsg@mail.gmail.com обсуждение исходный текст |
| Ответ на | update returning order by syntax error question (raf <raf@raf.org>) |
| Список | pgsql-general |
On Thu, Sep 12, 2019 at 5:45 AM raf <raf@raf.org> wrote:
> ERROR: syntax error at or near "t"
> LINE 2: tblname t
This works on 9.6.9 and 11.4:
luca=> with u as ( update t_all set id = 5 where id <= 5 returning *)
select * from u;
id | ref_id
----+--------
5 | 1
(1 row)
luca=> select version();
version
--------------------------------------------------------------------------------------------------
PostgreSQL 9.6.9 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu
7.2.0-8ubuntu3.2) 7.2.0, 64-bit
(1 row)
However, I know for sure that UPDATE has some restrictions on the
table aliasing (at least, they are not used as for a SELECT), so the
problem could be in the real query you are executing.
It works with or without the order by.
Luca
В списке pgsql-general по дате отправления: