Skip to content

Adding support for PostgreSQL's STATISTICS CREATE, ALTER, DROP and COMMENT ON.#2257

Open
LucaCappelletti94 wants to merge 4 commits intoapache:mainfrom
LucaCappelletti94:postgres-regression-11
Open

Adding support for PostgreSQL's STATISTICS CREATE, ALTER, DROP and COMMENT ON.#2257
LucaCappelletti94 wants to merge 4 commits intoapache:mainfrom
LucaCappelletti94:postgres-regression-11

Conversation

@LucaCappelletti94
Copy link
Contributor

This PR adds PostgreSQL-style support for CREATE STATISTICS, ALTER STATISTICS, DROP STATISTICS, and COMMENT ON STATISTICS (see docs: CREATE STATISTICS, ALTER STATISTICS, DROP STATISTICS, and COMMENT), with dedicated AST nodes (CreateStatistics, AlterStatistics, and related enums) plus parser integration in both PostgreSqlDialect and GenericDialect.

Since I am re-using parse_table_and_joins, which accepts just about anything, I have added a validation function which verifies post hoc that it is actually correct syntax. I am not too happy with that solution, but it was either that or rewriting a variant of parse_table_and_joins. Happy to hear suggestions.

This is yet another PR stemming from differential fuzzing with postgres 18 - I have about other 2500 crash cases, does anybody want some?

@LucaCappelletti94 LucaCappelletti94 marked this pull request as ready for review February 27, 2026 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant