Re: pg_restore -N loses extension comment

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_restore -N loses extension comment
Дата
Msg-id 4110200.1715093369@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pg_restore -N loses extension comment  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
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

diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_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 = SECTION_PRE_DATA;
     for (te = AH->toc->next; te != AH->toc; te = te->next)
     {
+        /* This bit must match ProcessArchiveRestoreOptions' marking logic */
         if (te->section != SECTION_NONE)
             curSection = te->section;
+        te->reqs = _tocEntryRequired(te, curSection, AH);
+        /* Now, should we print it? */
         if (ropt->verbose ||
-            (_tocEntryRequired(te, curSection, AH) & (REQ_SCHEMA | REQ_DATA)) != 0)
+            (te->reqs & (REQ_SCHEMA | REQ_DATA)) != 0)
         {
             char       *sanitized_name;
             char       *sanitized_schema;

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: New GUC autovacuum_max_threshold ?
Следующее
От: Bruce Momjian
Дата:
Сообщение: PERIOD foreign key feature