Re: BUG #19718: pg_dump -Ft: restore.sql gets "\unrestrict (null)"/"\restrict (null)", so psql skips \i data files

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pkopylov(at)cloudlinux(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org, Nathan Bossart <nathandbossart(at)gmail(dot)com>
Subject: Re: BUG #19718: pg_dump -Ft: restore.sql gets "\unrestrict (null)"/"\restrict (null)", so psql skips \i data files
Date: 2026-09-26 16:40:04
Message-ID: 13363.1790440804@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> Since commit 71ea0d6795 ("Restrict psql meta-commands in plain-text dumps"),
> _reconnectToDB() in src/bin/pg_dump/pg_backup_archiver.c writes

> ahprintf(AH, "\\unrestrict %s\n", ropt->restrict_key);
> ...
> ahprintf(AH, "\\restrict %s\n\n", ropt->restrict_key);

> without checking ropt->restrict_key.

Yeah, that's bad. It's not surprising that nobody noticed for
tar-format "restore.sql" files, because those are pretty much
write-only; I don't know of any tool that uses them. I wonder
though if there's any other way to reach this ...

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Manu 2026-09-26 18:14:04 Re: BUG #19621: Unexpected results of JSON_VALUE with DEFAULT ON EMPTY
Previous Message jian he 2026-09-26 16:28:59 Re: BUG #19621: Unexpected results of JSON_VALUE with DEFAULT ON EMPTY