Skip to content

Postgres: ALTER TABLE SET ( storage_parameters ) #1947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

achristmascarl
Copy link
Contributor

Closes #1946

@@ -351,6 +351,10 @@ pub enum AlterTableOperation {
ValidateConstraint {
name: Ident,
},
/// `SET ( storage_parameter [= value] [, ... ] )`
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we include a link to the docs where this syntax comes from?

Also I'm wondering whether storageparameter is right terminology here? From what I can tell with the syntax it looks possible that it accepts arbitrary sql option in parenthesis? If so thinking something generic like SetOptionsParens { options: Vec<SqlOption> } or similar naming as the enum variant

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so Postgres does expect one of a specific set of parameters there: https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-STORAGE-PARAMETERS

and will give ERROR: unrecognized parameter for an unexpected parameter. The parameters also have been the same in the last 5 versions, so they seem relatively stable.

Happy to either change to the more generic form, or update the parsing to look for the specific storage parameters instead of arbitrary options. Whatever you think is more appropriate @iffyio

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.

Postgres ALTER TABLE SET ( storage_parameter [= value] [, ... ] ) fails to parse
2 participants