Content-Length: 273526 | pFad | http://github.com/postgrespro/postgres/commit/c1aea206e3e333b8c9f8be20422426ae845dd0cf

4E Ensure that "pg_restore -l" reports dependent TOC entries correctly. · postgrespro/postgres@c1aea20 · GitHub
Skip to content

Commit c1aea20

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 c5bec54 commit c1aea20

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
@@ -1319,10 +1319,13 @@ PrintTOCSummary(Archive *AHX)
13191319
curSection = SECTION_PRE_DATA;
13201320
for (te = AH->toc->next; te != AH->toc; te = te->next)
13211321
{
1322+
/* This bit must match ProcessArchiveRestoreOptions' marking logic */
13221323
if (te->section != SECTION_NONE)
13231324
curSection = te->section;
1325+
te->reqs = _tocEntryRequired(te, curSection, AH);
1326+
/* Now, should we print it? */
13241327
if (ropt->verbose ||
1325-
(_tocEntryRequired(te, curSection, AH) & (REQ_SCHEMA | REQ_DATA)) != 0)
1328+
(te->reqs & (REQ_SCHEMA | REQ_DATA)) != 0)
13261329
{
13271330
char *sanitized_name;
13281331
char *sanitized_schema;

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/c1aea206e3e333b8c9f8be20422426ae845dd0cf

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy