Skip to content

PostgreSQL: Support ALTER COLUMN SET STATISTICS - #3080

Draft
icefery wants to merge 1 commit into
apache:mainfrom
icefery:postgres/alter-column-statistics
Draft

icefery wants to merge 1 commit into
apache:mainfrom
icefery:postgres/alter-column-statistics

Conversation

@icefery

@icefery icefery commented Dec 1, 2026

Copy link
Copy Markdown

Dialects: PostgreSQL, Generic

ALTER MATERIALIZED VIEW m ALTER COLUMN c SET STATISTICS 100; fails to parse. ALTER TABLE also lacks the named-column form of this action.

Both statements now use the same column operation for signed integer targets and DEFAULT, including the legacy -1 spelling. PostgreSQL grammar

Ten related tests passed with all features. Formatting and strict Clippy on the PostgreSQL test target passed. The round-trip fuzzer completed 256 runs seeded with a table statement and a materialized view statement.

AI assistance was used for the implementation, tests, and draft.

Parse signed integer and DEFAULT statistics targets for named columns in ALTER TABLE and ALTER MATERIALIZED VIEW.

Use the shared column operation for display and gate the syntax to PostgreSQL and Generic. Cover round-tripping and invalid targets.

@LucaCappelletti94 LucaCappelletti94 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the other PRs you have opened: add the fuzz seed and fuzz differentially the syntax against pg_query using the harness.

@LucaCappelletti94 LucaCappelletti94 added api change waiting on contributor The review needs further refinements by its author labels Dec 1, 2026
@icefery
icefery marked this pull request as draft December 1, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api change PostgreSQL waiting on contributor The review needs further refinements by its author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants