Skip to content

PostgreSQL: Support SET ACCESS METHOD on tables and materialized views - #3082

Draft
icefery wants to merge 1 commit into
apache:mainfrom
icefery:postgres/alter-set-access-method
Draft

icefery wants to merge 1 commit into
apache:mainfrom
icefery:postgres/alter-set-access-method

Conversation

@icefery

@icefery icefery commented Dec 1, 2026

Copy link
Copy Markdown

Dialects: PostgreSQL, Generic

ALTER TABLE t SET ACCESS METHOD heap; and ALTER MATERIALIZED VIEW v SET ACCESS METHOD DEFAULT; fail to parse. Both now preserve the access method in the AST. Bare DEFAULT resets the method; quoted "default" is an identifier. Ordinary ALTER VIEW still rejects the clause.

PostgreSQL grammar for names and DEFAULT

Twelve focused tests passed with all features. Rustfmt and Clippy on the library and Common/PostgreSQL test targets passed. The round-trip fuzzer completed 256 runs seeded with table and materialized-view statements.

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

- Parse a named access method or DEFAULT for both relation forms.
- Keep ordinary view syntax and other dialects unchanged.

@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.

As for your other PRs, add the fuzz seed and fuzz differentially the syntax against pg_query using the harness. Also, do recall the errors should not be string in the tests, but typed.

@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:25
@icefery

icefery commented Dec 1, 2026 •

Copy link
Copy Markdown
Author

As for your other PRs, add the fuzz seed and fuzz differentially the syntax against pg_query using the harness. Also, do recall the errors should not be string in the tests, but typed.

Ok, thanks, I will try. Then I change them to draft.

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