Skip to content

fix(postgresql): support pg_dump restrict commands - #136

Closed
ghost wants to merge 1 commit into
masterfrom
unknown repository
Closed

fix(postgresql): support pg_dump restrict commands#136
ghost wants to merge 1 commit into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Aug 30, 2026

Copy link
Copy Markdown

PostgreSQL plain-text dump output can include \restrict and \unrestrict psql guards, which sql-parser-cst currently rejects at the first backslash.

This change recognizes those two command lines only in the PostgreSQL dialect and preserves them as line-comment whitespace. CST consumers that enable includeComments can round-trip the guards, while unrelated psql meta-commands remain rejected.

The regression test round-trips both guards and the enclosed SQL using pg_dump's generated 63-character alphanumeric key shape.

Related to sql-formatter-org/sql-formatter#935 and sql-formatter-org/sql-formatter#966

@ghost ghost closed this by deleting the head repository Aug 30, 2026
This pull request was closed.
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.

0 participants