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

From Tom Lane
Subject Re: pg_class.reltype -> pg_type.oid missing for pg_toast table
Date
Msg-id 482455.1611074595@sss.pgh.pa.us
Whole thread Raw
In response to pg_class.reltype -> pg_type.oid missing for pg_toast table  ("Joel Jacobson" <joel@compiler.org>)
Responses Re: pg_class.reltype -> pg_type.oid missing for pg_toast table  ("Joel Jacobson" <joel@compiler.org>)
List pgsql-hackers
"Joel Jacobson" <joel@compiler.org> writes:
> 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".

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.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Isaac Morland
Date:
Subject: Re: popcount
Next
From: Julien Rouhaud
Date:
Subject: Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?