pg_class.reltype -> pg_type.oid missing for pg_toast table - Mailing list pgsql-hackers

From Joel Jacobson
Subject pg_class.reltype -> pg_type.oid missing for pg_toast table
Date
Msg-id badc16fc-b6bd-411f-b9c0-92f8ac1d0ae5@www.fastmail.com
Whole thread Raw
Responses Re: pg_class.reltype -> pg_type.oid missing for pg_toast table  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-hackers by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Stronger safeguard for archive recovery not to miss data
Next
From: David Fetter
Date:
Subject: Re: popcount