Re: information_schema.constraint_column_usage shows wrong table name

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: information_schema.constraint_column_usage shows wrong table name
Дата
Msg-id 3788089.1628610683@sss.pgh.pa.us
обсуждение исходный текст
Ответ на information_schema.constraint_column_usage shows wrong table name  (Alex Zeng <Alex.Zeng@datam.co.nz>)
Список 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 по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #17139: Invalid input syntax for uuid (politely this time!)
Следующее
От: Rainer Tammer
Дата:
Сообщение: Postgres 9.2.13 on AIX 7.1