From: Tom Lane <tgl@sss.pgh.pa.us>
To: raf <raf@raf.org>
Cc: pgsql-general@postgresql.org
Subject: Re: update returning order by syntax error question
Date: Thu, 12 Sep 2019 09:44:05 -0400
Message-ID: <13632.1568295845@sss.pgh.pa.us> (raw)
In-Reply-To: <20190912031743.jfbfj7e5ri5is36t@raf.org>
References: <20190912031743.jfbfj7e5ri5is36t@raf.org>
raf <raf@raf.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, raf@raf.org
Subject: Re: update returning order by syntax error question
In-Reply-To: <13632.1568295845@sss.pgh.pa.us>
References: <20190912031743.jfbfj7e5ri5is36t@raf.org> <13632.1568295845@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox