pgsql-ast-parser
pgsql-ast-parser copied to clipboard
Support selecting from unaliased sub-selects
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.