agora inbox for pgsql-bugs@postgresql.org  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pkopylov@cloudlinux.com
Cc: pgsql-bugs@lists.postgresql.org, Nathan Bossart <nathandbossart@gmail.com>
Subject: Re: BUG #19718: pg_dump -Ft: restore.sql gets "\unrestrict (null)"/"\restrict (null)", so psql skips \i data files
Date: Sat, 26 Sep 2026 12:40:04 -0400
Message-ID: <13363.1790440804@sss.pgh.pa.us> (raw)
In-Reply-To: <19718-7e945d0ff9b5a589@postgresql.org>
References: <19718-7e945d0ff9b5a589@postgresql.org>

PG Bug reporting form <noreply@postgresql.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






view thread (2+ messages)

Message-ID: <13363.1790440804@sss.pgh.pa.us>
Permalink:  ../13363.1790440804@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13363.1790440804@sss.pgh.pa.us

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pkopylov@cloudlinux.com, nathandbossart@gmail.com
  Subject: Re: BUG #19718: pg_dump -Ft: restore.sql gets "\unrestrict (null)"/"\restrict (null)", so psql skips \i data files
  In-Reply-To: <13363.1790440804@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox