Re: information_schema.referential_constraints contains NULLs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: CG <cgg007(at)yahoo(dot)com>
Cc: postgresql listserv <pgsql-general(at)postgresql(dot)org>
Subject: Re: information_schema.referential_constraints contains NULLs
Date: 2011-10-14 15:37:31
Message-ID: 934.1318606651@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

CG <cgg007(at)yahoo(dot)com> writes:
> For some of the referential constraints listed in my information_schema.referential_constraints table the values for the fields unique_constraint_catalog, unique_constraint_schema, and unique_constraint_name are NULL. There doesn't seem to be any rhyme or reason to which ones have values and which ones don't. They should all have values, right? Any ideas what could be going on?

PG will allow a foreign key constraint to be constructed when there is a
unique index for the referenced column(s). The unique index could have
been constructed via a UNIQUE or PRIMARY KEY constraint, or via a plain
old CREATE UNIQUE INDEX command. In the latter case there is no
constraint for the information_schema to show.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Carlos Mennens 2011-10-14 16:06:54 Confused About pg_* Tables
Previous Message CG 2011-10-14 15:11:12 information_schema.referential_constraints contains NULLs