目次
information_schema_catalog_nameadministrable_role_authorizationsapplicable_rolesattributescharacter_setscheck_constraint_routine_usagecheck_constraintscollationscollation_character_set_applicabilitycolumn_column_usagecolumn_domain_usagecolumn_optionscolumn_privilegescolumn_udt_usagecolumnsconstraint_column_usageconstraint_table_usagedata_type_privilegesdomain_constraintsdomain_udt_usagedomainselement_typesenabled_rolesforeign_data_wrapper_optionsforeign_data_wrappersforeign_server_optionsforeign_serversforeign_table_optionsforeign_tableskey_column_usageparametersreferential_constraintsrole_column_grantsrole_routine_grantsrole_table_grantsrole_udt_grantsrole_usage_grantsroutine_column_usageroutine_privilegesroutine_routine_usageroutine_sequence_usageroutine_table_usageroutinesschematasequencessql_featuressql_implementation_infosql_partssql_sizingtable_constraintstable_privilegestablestransformstriggered_update_columnstriggersudt_privilegesusage_privilegesuser_defined_typesuser_mapping_optionsuser_mappingsview_column_usageview_routine_usageview_table_usageviewsThe information schema consists of a set of views that contain information about the objects defined in the current database. The information schema is defined in the SQL standard and can therefore be expected to be portable and remain stable — unlike the system catalogs, which are specific to <productname>PostgreSQL</productname> and are modeled after implementation concerns. The information schema views do not, however, contain information about <productname>PostgreSQL</productname>-specific features; to inquire about those you need to query the system catalogs or other <productname>PostgreSQL</productname>-specific views. 情報スキーマは、現在のデータベースで定義されたオブジェクトについての情報を持つビューの集合から構成されます。 情報スキーマは標準SQLで定義されています。 したがって、PostgreSQLに特化し、実装上の事項にならって作成されるシステムカタログとは異なり、移植性があり、安定性を保持できるものと期待できます。 しかし、情報スキーマのビューには、PostgreSQL固有の機能についての情報が含まれていません。 これに問い合わせを行うためには、システムカタログもしくはPostgreSQL固有のビューに問い合わせを行う必要があります。
When querying the database for constraint information, it is possible for a standard-compliant query that expects to return one row to return several. This is because the SQL standard requires constraint names to be unique within a schema, but <productname>PostgreSQL</productname> does not enforce this restriction. <productname>PostgreSQL</productname> automatically-generated constraint names avoid duplicates in the same schema, but users can specify such duplicate names. 制約情報についてデータベースに問い合わせるとき、一行を返すことが想定される標準に準拠したクエリが数行の結果を返す場合があります。 これは、制約名がスキーマ内で一意になることを標準SQLが要求しているのに対して、PostgreSQLはこの制約を強制しないためです。 PostgreSQLは自動生成される制約の名前がスキーマ内で重複することを防ぎますが、ユーザは重複する名前を指定できます。
This problem can appear when querying information schema views such
as <literal>check_constraint_routine_usage</literal>,
<literal>check_constraints</literal>, <literal>domain_constraints</literal>, and
<literal>referential_constraints</literal>. Some other views have similar
issues but contain the table name to help distinguish duplicate
rows, e.g., <literal>constraint_column_usage</literal>,
<literal>constraint_table_usage</literal>, <literal>table_constraints</literal>.
この問題は、check_constraint_routine_usageやcheck_constraints、domain_constraints、referential_constraintsといった情報スキーマビューを検索するときに表面化することがあります。
いくつかの他のビューにも同様の問題がありますが、重複行を識別する助けになるテーブル名を含んでいます。例えばconstraint_column_usageやconstraint_table_usage、table_constraintsなどです。