36.31. key_column_usage
Представление key_column_usage
описывает все столбцы в текущей базе, с которыми связано какое-либо ограничение уникальности, либо ограничение первичного или внешнего ключа. Ограничения-проверки в этом представлении не показываются. В нём показываются только те столбцы, к которым имеет доступ текущий пользователь (являясь владельцем или имея некоторые права).
Таблица 36.29. Столбцы key_column_usage
Имя | Тип данных | Описание |
---|---|---|
constraint_catalog | sql_identifier | Имя базы данных, содержащей ограничение (всегда текущая база) |
constraint_schema | sql_identifier | Имя схемы, содержащей ограничение |
constraint_name | sql_identifier | Имя ограничения |
table_catalog | sql_identifier | Имя базы данных, содержащей таблицу со столбцом, подчиняющимся этому ограничению (всегда текущая база) |
table_schema | sql_identifier | Имя схемы, содержащей таблицу со столбцом, подчиняющимся этому ограничению |
table_name | sql_identifier | Имя таблицы со столбцом, подчиняющимся этому ограничению |
column_name | sql_identifier | Имя столбца, подчиняющегося этому ограничению |
ordinal_position | cardinal_number | Порядковый номер столбца в ключе ограничения (нумерация начинается с 1) |
position_in_unique_constraint | cardinal_number | Для ограничения внешнего ключа это порядковый номер целевого столбца в его ограничении уникальности (нумерация начинается с 1); в противном случае NULL |
36.13. column_domain_usage
The view column_domain_usage
identifies all columns (of a table or a view) that make use of some domain defined in the current database and owned by a currently enabled role.
Table 36.11. column_domain_usage
Columns
Name | Data Type | Description |
---|---|---|
domain_catalog | sql_identifier | Name of the database containing the domain (always the current database) |
domain_schema | sql_identifier | Name of the schema containing the domain |
domain_name | sql_identifier | Name of the domain |
table_catalog | sql_identifier | Name of the database containing the table (always the current database) |
table_schema | sql_identifier | Name of the schema containing the table |
table_name | sql_identifier | Name of the table |
column_name | sql_identifier | Name of the column |