Ensure that "pg_restore -l" reports dependent TOC entries correctly.
authorTom Lane <[email protected]>
Tue, 7 May 2024 22:22:52 +0000 (18:22 -0400)
committerTom Lane <[email protected]>
Tue, 7 May 2024 22:23:11 +0000 (18:23 -0400)
commit52b23b4e1c6f703a6617c027a5def99772af4ce4
tree69ffcb010203b7bf318dc3fba0a1b1fc26e79b07
parent90d39929a8900ba38a3ded503481867ca3182849
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 0d4e6ed30
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
src/bin/pg_dump/pg_backup_archiver.c