Skip to content

PostgreSQL UNLOGGED Table Support and ALTER TABLE ... SET LOGGED|UNLOGGED#2251

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

PostgreSQL UNLOGGED Table Support and ALTER TABLE ... SET LOGGED|UNLOGGED#2251
LucaCappelletti94 wants to merge 4 commits intoapache:mainfrom
LucaCappelletti94:postgres-regression-6

Conversation

@LucaCappelletti94
Copy link
Contributor

This change adds parser and AST support for PostgreSQL table logging controls:

  1. CREATE UNLOGGED TABLE ...
  2. ALTER TABLE ... SET LOGGED
  3. ALTER TABLE ... SET UNLOGGED

It also adds regression tests and updates cross-dialect test fixtures impacted by the AST shape change.

Add parser and AST support for PostgreSQL CREATE UNLOGGED TABLE and\nALTER TABLE ... SET LOGGED|UNLOGGED operations.\n\n- add LOGGED keyword\n- add CreateTable.unlogged and wire it through CreateTableBuilder\n- render UNLOGGED in CreateTable display\n- add AlterTableOperation::SetLogged and ::SetUnlogged display/spans\n- parse UNLOGGED only for PostgreSqlDialect|GenericDialect\n- parse ALTER TABLE SET LOGGED|UNLOGGED operations
Add PostgreSQL regression coverage for the new syntax support and\nupdate existing struct-literal CreateTable expectations with the\nnew unlogged field in cross-dialect tests.\n\n- add parse_create_unlogged_table\n- add parse_alter_table_set_logged_unlogged\n- set unlogged defaults in duckdb/mssql fixture assertions
Refactor parser match arms to use guards instead of nested if blocks where Clippy flagged collapsible_match.

This keeps behavior unchanged while making control flow clearer in statement parsing, wildcard qualification handling, terminal keyword detection, and Hive row format delimiter parsing.
Refactor parse_alter_table_operation to collapse a nested else-if structure into a direct else-if chain for PostgreSQL/GEDERIC SET LOGGED and SET UNLOGGED handling.

This is a no-behavior-change control-flow cleanup aligned with Clippy's collapsible_else_if lint under -D warnings.
@LucaCappelletti94 LucaCappelletti94 marked this pull request as ready for review February 27, 2026 09:23
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