BUG #17232: DISTINCT ON does not allow AS

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: kyle(at)lahnakoski(dot)com
Subject: BUG #17232: DISTINCT ON does not allow AS
Date: 2021-10-15 22:41:35
Message-ID: 17232-f7e20e9639b6a6c9@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 17232
Logged by: Kyle Lahnakoski
Email address: kyle(at)lahnakoski(dot)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;
```

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2021-10-15 23:01:08 Re: BUG #17232: DISTINCT ON does not allow AS
Previous Message Tom Lane 2021-10-15 18:24:51 Re: BUG #17231: ERROR: tuple concurrently updated