Re: update returning order by syntax error question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: raf <raf(at)raf(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: update returning order by syntax error question
Date: 2019-09-12 13:44:05
Message-ID: 13632.1568295845@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

raf <raf(at)raf(dot)org> writes:
> It's almost as if the parser sees "update" as a possible
> table name (rather than a reserved word) and "tblname"
> as the alias for that table and it's expecting a comma
> or left/right/full etc. when it seess the "t".

No, it's *exactly* as if that. UPDATE is an unreserved
keyword so it's fully legitimate as a table name.
If you made the syntax be what the grammar is expecting:

regression=# select * from (update t cross join update t2);
ERROR: relation "update" does not exist
LINE 1: select * from (update t cross join update t2);
^

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Gauthier 2019-09-12 14:08:34 Web GUI for PG table ?
Previous Message Francisco Olarte 2019-09-12 11:58:16 Re: How to reformat output of "age()" function