Fabien COELHO <coe...@cri.ensmp.fr> writes:
> The REFERENTIAL_CONSTRAINTS table in the information_schema references a 
> constaint through its database/schema/name, but this information is not 
> unique, so it may identify several constraints, thus the information 
> derived may not be consistent.

Postgres does not enforce that constraints have unique names within a
schema.  The SQL spec does say that they should be unique per-schema,
and the information_schema views are designed on that assumption.

If you use spec-compliant names for your constraints, you won't have a
problem.  If you don't, well, the information_schema views will be of
limited use to you.

> Suggestion: constraint names could be systematically prefixed with their 
> corresponding table so that they are indeed unique,

We are not going to try to enforce uniqueness.  This has been debated
before, and most people like the current behavior just fine, or at least
better than the alternatives.

                        regards, tom lane

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to