Re: pg_class.reltype -> pg_type.oid missing for pg_toast table

Поиск
Список
Период
Сортировка
От Joel Jacobson
Тема Re: pg_class.reltype -> pg_type.oid missing for pg_toast table
Дата
Msg-id 752d608c-3026-4fb7-8c3f-a5271aa51cad@www.fastmail.com
обсуждение исходный текст
Ответ на Re: pg_class.reltype -> pg_type.oid missing for pg_toast table  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Tue, Jan 19, 2021, at 17:43, Tom Lane wrote:
>I'm too lazy to check the code right now, but my recollection is that we
>do not bother to make composite-type entries for toast tables.  However,
>they should have reltype = 0 if so, so I'm not quite sure where the
>above failure is coming from.

My apologies, false alarm.

The problem turned out to be due to doing

    CREATE TABLE catalog_fks.%1$I AS
    SELECT * FROM pg_catalog.%1$I

which causes changes to e.g. pg_catalog.pg_class during the command is running.

Solved by instead using COPY ... TO to first copy catalogs to files on disk,
which doesn't cause changes to the catalogs,
and then using COPY .. FROM to copy the data into the replicated table structures.

/Joel

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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Deleting older versions in unique indexes to avoid page splits
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [PATCH 1/1] Initial mach based shared memory support.