pgsql-ast-parser icon indicating copy to clipboard operation
pgsql-ast-parser copied to clipboard

Support selecting from unaliased sub-selects

Open bcemmett opened this issue 11 months ago • 0 comments

Historically, when selecting from a sub-select eg select * from (select id from test) t1 Postgres required that the subquery (select id from test) be aliased, in this case as t1.

As of Postgres 16, this is no longer the case - see this patch for details, or the Postgres 16 release notes (search that page for "alias"). So it's now fine to just write select * from (select id from test).

This PR relaxes the grammar to match that change & updates the tests accordingly.

bcemmett avatar Jan 13 '25 02:01 bcemmett