pg_dump fails to lock partitioned tables

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pg_dump fails to lock partitioned tables
Дата
Msg-id 1018205.1634346327@sss.pgh.pa.us
обсуждение исходный текст
Список pgsql-hackers
While fooling with something else, I happened to notice $SUBJECT.
The reason turns out to be that it's checking the wrong element
of the tblinfo[] array; see one-liner fix attached.

I had a feeling of deja vu about this bug, and indeed a dig in
the git history shows that we fixed it in passing in 403a3d91c.
But that later got reverted, and we forgot to keep the bug fix.

            regards, tom lane

diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index a485fb2d07..5deb347f34 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -7016,7 +7016,7 @@ getTables(Archive *fout, int *numTables)
          */
         if (tblinfo[i].dobj.dump &&
             (tblinfo[i].relkind == RELKIND_RELATION ||
-             tblinfo->relkind == RELKIND_PARTITIONED_TABLE) &&
+             tblinfo[i].relkind == RELKIND_PARTITIONED_TABLE) &&
             (tblinfo[i].dobj.dump & DUMP_COMPONENTS_REQUIRING_LOCK))
         {
             resetPQExpBuffer(query);

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [RFC] building postgres with meson
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Trivial doc patch