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

From: "Joel Jacobson" <joel(at)compiler(dot)org>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: pg_class.reltype -> pg_type.oid missing for pg_toast table
Date: 2021-01-19 16:34:36
Message-ID: badc16fc-b6bd-411f-b9c0-92f8ac1d0ae5@www.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I have a memory of the catalog not being MVCC,
so maybe this is normal and expected,
but I wanted to report it in case it's not.

When copying all tables in pg_catalog, to a separate schema with the purpose
of testing if foreign keys could be added for all oid columns, I got an error for a toast table:

ERROR: insert or update on table "pg_class" violates foreign key constraint "pg_class_reltype_fkey"
DETAIL: Key (reltype)=(86987582) is not present in table "pg_type".
CONTEXT: SQL statement "
ALTER TABLE catalog_fks.pg_class ADD FOREIGN KEY (reltype) REFERENCES catalog_fks.pg_type (oid)
"

The copies of pg_catalog were executed in one and the same transaction,
but as separate queries in a PL/pgSQL function using EXECUTE.

/Joel

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2021-01-19 16:38:19 Re: popcount
Previous Message Laurenz Albe 2021-01-19 16:05:35 Re: Stronger safeguard for archive recovery not to miss data