Re: information_schema.constraint_column_usage shows wrong table name - Mailing list pgsql-bugs

From Tom Lane
Subject Re: information_schema.constraint_column_usage shows wrong table name
Date
Msg-id 3788089.1628610683@sss.pgh.pa.us
Whole thread Raw
In response to information_schema.constraint_column_usage shows wrong table name  (Alex Zeng <Alex.Zeng@datam.co.nz>)
List pgsql-bugs
Alex Zeng <Alex.Zeng@datam.co.nz> writes:
> When creating a constraint from table A to table B, the table name and column name in
information_schema.constraint_column_usage shows table B. That makes impossible to check whether a constraint exists as
wecan have a constraint from table C to B and they will have same value in information_schema.constraint_column_usage. 

The SQL standard says the purpose of this view is to

    Identify the columns used by referential constraints, unique
    constraints, check constraints, and assertions defined in this catalog
    and owned by a given user or role.

so I think the view is showing the column name it is supposed to,
ie the referenced column name not the referencing column name.
The key_column_usage view might help you with the other thing.

            regards, tom lane



pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: BUG #17139: Invalid input syntax for uuid (politely this time!)
Next
From: Rainer Tammer
Date:
Subject: Postgres 9.2.13 on AIX 7.1