Re: issue about information_schema REFERENTIAL_CONSTRAINTS - Mailing list pgsql-bugs

From Tom Lane
Subject Re: issue about information_schema REFERENTIAL_CONSTRAINTS
Date
Msg-id 6462.1283454730@sss.pgh.pa.us
Whole thread Raw
In response to Re: issue about information_schema REFERENTIAL_CONSTRAINTS  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: issue about information_schema REFERENTIAL_CONSTRAINTS  (Fabien COELHO <coelho@cri.ensmp.fr>)
List pgsql-bugs
Fabien COELHO <coelho@cri.ensmp.fr> writes:
> (1) use the OID as the "constraint name" everywhere, it would work, it
> would not look so good for display, but it is simple and fast.

> (2) otherwise something built on top of <table,constraint>. To be on the
> safe side, I would build a string (sql_identifier?) with something like:

>      quote_ident(<table name>) || '.' || quote_ident(<constraint name>)

Note that (2) fails for long names; you have to do something to
compress to NAMEDATALEN.

The big problem with either of these is that it's no longer easily
possible to extract the actual constraint name from the view.

In any case, I am fairly sure that not having the constraint_name column
show the actual constraint name is a violation of the spirit of the SQL
spec, whether or not you can claim that it meets the letter.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: issue about information_schema REFERENTIAL_CONSTRAINTS
Next
From: Alexsander Rosa
Date:
Subject: Re: BUG #5629: ALTER SEQUENCE foo START execute a RESTART