Skip to content

Commit a3c00ab

Browse files
committed
Ensure that "pg_restore -l" reports dependent TOC entries correctly.
If -l was specified together with selective-restore options such as -n or -N, dependent TOC entries such as comments would be omitted from the listing, even when an actual restore would have selected them. This happened because PrintTOCSummary neglected to update the te->reqs marking of the entry they depended on. Per report from Justin Pryzby. This has been wrong since 0d4e6ed taught _tocEntryRequired to sometimes look at the "reqs" marking of other TOC entries, so back-patch to all supported branches. Discussion: https://postgr.es/m/ZjoeirG7yxODdC4P@pryzbyj2023
1 parent 4488142 commit a3c00ab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1222,10 +1222,13 @@ PrintTOCSummary(Archive *AHX)
12221222
curSection = SECTION_PRE_DATA;
12231223
for (te = AH->toc->next; te != AH->toc; te = te->next)
12241224
{
1225+
/* This bit must match ProcessArchiveRestoreOptions' marking logic */
12251226
if (te->section != SECTION_NONE)
12261227
curSection = te->section;
1228+
te->reqs = _tocEntryRequired(te, curSection, AH);
1229+
/* Now, should we print it? */
12271230
if (ropt->verbose ||
1228-
(_tocEntryRequired(te, curSection, AH) & (REQ_SCHEMA | REQ_DATA)) != 0)
1231+
(te->reqs & (REQ_SCHEMA | REQ_DATA)) != 0)
12291232
{
12301233
char *sanitized_name;
12311234
char *sanitized_schema;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy