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;
```