Skip to content

Conversation

@Billiam
Copy link

@Billiam Billiam commented Oct 23, 2025

If an SQL dump contains both dumped from/by comments and \restrict, the comments and double newlines are both removed before \restrict is removed, so this input:

\restrict eVA4gCZvdSnhJn7MKha0lZbmA4

-- Dumped from database version 17.4
-- Dumped by pg_dump version 17.6

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;

becomes:



SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;

after cleanup.

To fix this, I'm trimming all newlines that follow the restrict, instead of limiting the replacement to 2 newline.

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