From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: kyle@lahnakoski.com
Subject: BUG #17232: DISTINCT ON does not allow AS
Date: Fri, 15 Oct 2021 22:41:35 +0000
Message-ID: <17232-f7e20e9639b6a6c9@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 17232
Logged by: Kyle Lahnakoski
Email address: kyle@lahnakoski.com
PostgreSQL version: 14.0
Operating system: windows
Description:
The following SQL has an unexpected syntax error
SELECT DISTINCT ON (col) AS col, col2 FROM test
The AS clause is usually used to indicate alias, but it does not work in
this case
```
postgres=#
postgres=# SELECT version();
version
------------------------------------------------------------
PostgreSQL 14.0, compiled by Visual C++ build 1914, 64-bit
(1 row)
postgres=# SELECT DISTINCT ON (col) AS col, col2 FROM test;
ERROR: syntax error at or near "AS"
LINE 1: SELECT DISTINCT ON (col) AS col, col2 FROM test;
```
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, kyle@lahnakoski.com
Subject: Re: BUG #17232: DISTINCT ON does not allow AS
In-Reply-To: <17232-f7e20e9639b6a6c9@postgresql.org>
* 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