Re: Binary upgrade from <12 to 12 creates toast table forpartitioned tables

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Binary upgrade from <12 to 12 creates toast table forpartitioned tables
Дата
Msg-id 20190308232054.qpukw3kcbhbci5ox@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: Binary upgrade from <12 to 12 creates toast table forpartitioned tables  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: Binary upgrade from <12 to 12 creates toast table forpartitioned tables
Список pgsql-hackers
Hi,

On 2019-03-08 20:18:27 -0300, Alvaro Herrera wrote:
> On 2019-Mar-07, Robert Haas wrote:
> 
> > On Wed, Mar 6, 2019 at 3:41 PM Andres Freund <andres@anarazel.de> wrote:
> > > I think we probably should have pg_dump suppress emitting information
> > > about the toast table of partitioned tables?
> > 
> > +1.  That seems like the right fix.
> 
> This patch fixes the upgrade problem for me.

Thanks!


> -- 
> Álvaro Herrera                https://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

> diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
> index e962ae7e913..1de8da59361 100644
> --- a/src/bin/pg_dump/pg_dump.c
> +++ b/src/bin/pg_dump/pg_dump.c
> @@ -4359,9 +4359,9 @@ binary_upgrade_set_type_oids_by_rel_oid(Archive *fout,
>                        "SELECT c.reltype AS crel, t.reltype AS trel "
>                        "FROM pg_catalog.pg_class c "
>                        "LEFT JOIN pg_catalog.pg_class t ON "
> -                      "  (c.reltoastrelid = t.oid) "
> +                      "  (c.reltoastrelid = t.oid AND c.relkind <> '%c') "
>                        "WHERE c.oid = '%u'::pg_catalog.oid;",
> -                      pg_rel_oid);
> +                      RELKIND_PARTITIONED_TABLE, pg_rel_oid);

Hm, I know this code isn't generally well documented, but perhaps we
could add a comment as to why we're excluding partitioned tables?

Greetings,

Andres Freund


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Binary upgrade from <12 to 12 creates toast table forpartitioned tables
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: Checksum errors in pg_stat_database