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.94.2) (envelope-from ) id 1s4M8N-0035Ga-Tc for pgsql-hackers@arkaria.postgresql.org; Tue, 07 May 2024 14:49:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s4M8K-003PJ7-Ow for pgsql-hackers@arkaria.postgresql.org; Tue, 07 May 2024 14:49:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s4M8K-003PIz-FK for pgsql-hackers@lists.postgresql.org; Tue, 07 May 2024 14:49:33 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s4M8I-002194-PT for pgsql-hackers@lists.postgresql.org; Tue, 07 May 2024 14:49:32 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 447EnTTu4110201; Tue, 7 May 2024 10:49:29 -0400 From: Tom Lane To: Justin Pryzby cc: pgsql-hackers@lists.postgresql.org Subject: Re: pg_restore -N loses extension comment In-reply-to: <4054893.1715089969@sss.pgh.pa.us> References: <4054893.1715089969@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Tue, 07 May 2024 09:52:49 -0400" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <4110152.1715093355.0@sss.pgh.pa.us> Date: Tue, 07 May 2024 10:49:29 -0400 Message-ID: <4110200.1715093369@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4110152.1715093355.1@sss.pgh.pa.us> I wrote: > I think this may be a bug in -l mode: ProcessArchiveRestoreOptions > saves the result of _tocEntryRequired in te->reqs, but PrintTOCSummary > doesn't, and that will bollix its subsequent _tocEntryRequired checks > for "dependent" TOC entries. Yeah ... the attached seems to fix it. regards, tom lane ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="fix-selective-l-mode.patch"; charset="us-ascii" Content-ID: <4110152.1715093355.2@sss.pgh.pa.us> Content-Description: fix-selective-l-mode.patch Content-Transfer-Encoding: quoted-printable diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_bac= kup_archiver.c index c6c101c118..56e0688154 100644 --- a/src/bin/pg_dump/pg_backup_archiver.c +++ b/src/bin/pg_dump/pg_backup_archiver.c @@ -1319,10 +1319,13 @@ PrintTOCSummary(Archive *AHX) curSection =3D SECTION_PRE_DATA; for (te =3D AH->toc->next; te !=3D AH->toc; te =3D te->next) { + /* This bit must match ProcessArchiveRestoreOptions' marking logic */ if (te->section !=3D SECTION_NONE) curSection =3D te->section; + te->reqs =3D _tocEntryRequired(te, curSection, AH); + /* Now, should we print it? */ if (ropt->verbose || - (_tocEntryRequired(te, curSection, AH) & (REQ_SCHEMA | REQ_DATA)) !=3D= 0) + (te->reqs & (REQ_SCHEMA | REQ_DATA)) !=3D 0) { char *sanitized_name; char *sanitized_schema; ------- =_aaaaaaaaaa0--