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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Joel Jacobson" <joel(at)compiler(dot)org>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pg_class.reltype -> pg_type.oid missing for pg_toast table
Date: 2021-01-19 16:43:15
Message-ID: 482455.1611074595@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Joel Jacobson" <joel(at)compiler(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2021-01-19 16:43:25 Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?
Previous Message Isaac Morland 2021-01-19 16:41:58 Re: popcount