Re: update returning order by syntax error question - Mailing list pgsql-general

From Tom Lane
Subject Re: update returning order by syntax error question
Date
Msg-id 19619.1568299095@sss.pgh.pa.us
Whole thread Raw
In response to Re: update returning order by syntax error question  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
Adrian Klaver <adrian.klaver@aklaver.com> writes:
> On 9/12/19 6:44 AM, Tom Lane wrote:
>> No, it's *exactly* as if that.  UPDATE is an unreserved
>> keyword so it's fully legitimate as a table name.

> I am not following.

Sure, the WITH thing works too.  The point is that given
"SELECT ... FROM (UPDATE ...)", there is a workable parse
path where UPDATE is treated as a table name.  So if you
try to put an UPDATE command there, the syntax error
isn't thrown till a couple tokens later, where the
table-name syntax no longer matches.  The OP's question
was about why the error was thrown where it was, not about
how to do this correctly.

            regards, tom lane



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: update returning order by syntax error question
Next
From: Adrian Klaver
Date:
Subject: Re: Web GUI for PG table ?