Creates a view to get a list of foreign keys in the database. That includes the check for an existing single index, see boolean result of column “is_indexed”.
Columns
Column Name
datatype
Description
constraint_name
name
The name of the constraint.
is_deferrable
character varying
Whether the setting can be changed within a transaction.
initially_deferred
character varying
Whether each row is checked on insert or at the end of the transaction.
enforced
character varying
For PostgreSQL versions <18 it is alway TRUE as the feature is not availabe, starting with PostgreSQL 18 it is TRUE, when the constraint is enforced.
table_schema
name
The name of the schema
table_name
name
The name of the table.
column_name
name
Name of the column used in the foreign key constraint.
foreign_table_schema
name
The name of the foreign schema.
foreign_table_name
name
The name of the foreign table.
foreign_column_name
name
Name of the column used in the foreign key constraint of a foreign table.
is_indexed
boolean
Whether an index exists for the foreign key constraint, or not.