Comunitatea PHP Romania
 

 
pg_constraint

43.13. pg_constraint

The catalog pg_constraint stores check, primary key, unique, and foreign key constraints on tables. (Column constraints are not treated specially. Every column constraint is equivalent to some table constraint.) Not-null constraints are represented in the pg_attribute catalog.

Check constraints on domains are stored here, too.

Table 43-13. pg_constraint Columns

NameTypeReferencesDescription
connamename Constraint name (not necessarily unique!)
connamespaceoidpg_namespace.oid The OID of the namespace that contains this constraint
contypechar  c = check constraint, f = foreign key constraint, p = primary key constraint, u = unique constraint
condeferrablebool Is the constraint deferrable?
condeferredbool Is the constraint deferred by default?
conrelidoidpg_class.oidThe table this constraint is on; 0 if not a table constraint
contypidoidpg_type.oidThe domain this constraint is on; 0 if not a domain constraint
confrelidoidpg_class.oidIf a foreign key, the referenced table; else 0
confupdtypechar Foreign key update action code
confdeltypechar Foreign key deletion action code
confmatchtypechar Foreign key match type
conkeyint2[]pg_attribute.attnumIf a table constraint, list of columns which the constraint constrains
confkeyint2[]pg_attribute.attnumIf a foreign key, list of the referenced columns
conbintext If a check constraint, an internal representation of the expression
consrctext If a check constraint, a human-readable representation of the expression

Note: consrc is not updated when referenced objects change; for example, it won't track renaming of columns. Rather than relying on this field, it's best to use pg_get_constraintdef() to extract the definition of a check constraint.

Note: pg_class.relchecks needs to agree with the number of check-constraint entries found in this table for the given relation.

Ultimele discutii in forum RSS Forum

Ultimele articole Ultimele articole

Top membri

Pirahna Pirahna
acasa , in pat
carco carco
Bucuresti
Birkoff Birkoff
Bucuresti
Mascka Mascka
Braila
raul_ raul_
whooper whooper
Toronto ON
mihaitha mihaitha
Sibiu
gabysolomon gabysolomon
Bacau
oriceon oriceon
Constanta
garlicinicolae garlicinicolae

Newsletter


Email:
 inscriere
 renuntare
 
 Arhiva newsletter

Parteneriat

Copyright © 2001-2008 PHP Romania Add PHPRomania to Google Add PHPRomania to Del.icio.us Add PHPRomania to Stumbleupon Add PHPRomania to Yahoo! Add PHPRomania to Digg Add PHPRomania to Blink Mortgage Calculator | Credit Cards | Cheap Loan | Credit Cards | Car Finance
Ads: Partener Way2Web Nework: gazduire web | inregistrare domenii | web design | imobiliare | web hosting
Powered by Simplis