Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xAVRc-00000002gdf-1LXs for pgsql-bugs@arkaria.postgresql.org; Sat, 26 Sep 2026 16:40:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xAVRb-00000004iuT-1ITK for pgsql-bugs@arkaria.postgresql.org; Sat, 26 Sep 2026 16:40:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xAVRb-00000004iuK-07mF for pgsql-bugs@lists.postgresql.org; Sat, 26 Sep 2026 16:40:11 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xAVRX-00000001NQk-3pNN for pgsql-bugs@lists.postgresql.org; Sat, 26 Sep 2026 16:40:10 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 68QGe4lG013364; Sat, 26 Sep 2026 12:40:05 -0400 From: Tom Lane To: pkopylov@cloudlinux.com cc: pgsql-bugs@lists.postgresql.org, Nathan Bossart Subject: Re: BUG #19718: pg_dump -Ft: restore.sql gets "\unrestrict (null)"/"\restrict (null)", so psql skips \i data files In-reply-to: <19718-7e945d0ff9b5a589@postgresql.org> References: <19718-7e945d0ff9b5a589@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Thu, 24 Sep 2026 21:24:46 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13362.1790440804.1@sss.pgh.pa.us> Date: Sat, 26 Sep 2026 12:40:04 -0400 Message-ID: <13363.1790440804@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form 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