Re: Information Schema and constraint names not unique - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Information Schema and constraint names not unique
Date
Msg-id 19552.1068131498@sss.pgh.pa.us
Whole thread Raw
In response to Information Schema and constraint names not unique  (Philip Warner <pjw@rhyme.com.au>)
Responses Re: Information Schema and constraint names not unique  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Philip Warner <pjw@rhyme.com.au> writes:
> Notice that the two records are identical because the two constraint names 
> are the same. ISTM that we should have a way of usefully examining specific 
> constraints without having to name them. Can we add the constraint OID or 

No.  The schemas of the information_schema views are defined by the
standard; I don't think we get to invent columns, especially not columns
with such PG-specific contents as OIDs.

> some other identifier (table?) or ensure that constraint names are unique?

The reason the spec defines these views this way is that it expects
constraint names to be unique across a whole schema.  We don't enforce
that, and I don't think we want to start doing so (that was already
proposed and shot down at least once).  You are of course free to use
constraint names that are distinct if you want to follow the spec's
lead.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [pgsql-www] Changes to Contributor List
Next
From: Tom Lane
Date:
Subject: Re: Very poor estimates from planner