doc-exports/docs/dws/dev/dws_04_0860.html
Lu, Huayi e6fa411af0 DWS DEV 830.201 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-05-16 07:24:04 +00:00

7.6 KiB

USER_CONSTRAINTS

USER_CONSTRAINTS displays the table constraint information accessible to the current user.

Name

Type

Description

constraint_name

vcharacter varying(64)

Constraint name

constraint_type

text

Constraint type

  • C: Check constraint.
  • F: Foreign key constraint
  • P: Primary key constraint
  • U: Unique constraint.

table_name

character varying(64)

Name of constraint-related table

index_owner

character varying(64)

Owner of constraint-related index (only for the unique constraint and primary key constraint)

index_name

character varying(64)

Name of constraint-related index (only for the unique constraint and primary key constraint)

Example

Query constraints on a specified table owned by the current user. Replace t1 with the actual table name.

1
2
3
4
5
SELECT * FROM USER_CONSTRAINTS WHERE table_name='t1';
 constraint_name | constraint_type | table_name | index_owner |  index_name
-----------------+-----------------+------------+-------------+---------------
 c_custkey_key   | p               | t1         | u1          | c_custkey_key
(1 row)