18 #ifndef PG_CONSTRAINT_H 19 #define PG_CONSTRAINT_H 23 #include "catalog/pg_constraint_d.h" 31 CATALOG(pg_constraint,2606,ConstraintRelationId)
110 #ifdef CATALOG_VARLEN 163 DECLARE_INDEX(pg_constraint_conname_nsp_index, 2664, on pg_constraint
using btree(conname name_ops, connamespace oid_ops));
164 #define ConstraintNameNspIndexId 2664 165 DECLARE_UNIQUE_INDEX(pg_constraint_conrelid_contypid_conname_index, 2665, on pg_constraint
using btree(conrelid oid_ops, contypid oid_ops, conname name_ops));
166 #define ConstraintRelidTypidNameIndexId 2665 167 DECLARE_INDEX(pg_constraint_contypid_index, 2666, on pg_constraint
using btree(contypid oid_ops));
168 #define ConstraintTypidIndexId 2666 170 #define ConstraintOidIndexId 2667 171 DECLARE_INDEX(pg_constraint_conparentid_index, 2579, on pg_constraint
using btree(conparentid oid_ops));
172 #define ConstraintParentIndexId 2579 178 #ifdef EXPOSE_TO_CLIENT_CODE 181 #define CONSTRAINT_CHECK 'c' 182 #define CONSTRAINT_FOREIGN 'f' 183 #define CONSTRAINT_PRIMARY 'p' 184 #define CONSTRAINT_UNIQUE 'u' 185 #define CONSTRAINT_TRIGGER 't' 186 #define CONSTRAINT_EXCLUSION 'x' 208 Oid constraintNamespace,
215 const int16 *constraintKey,
217 int constraintNTotalKeys,
221 const int16 *foreignKey,
226 char foreignUpdateType,
227 char foreignDeleteType,
228 char foreignMatchType,
241 const char *conname);
254 bool missing_ok,
Oid *constraintOid);
262 Oid *pf_eq_oprs,
Oid *pp_eq_oprs,
Oid *ff_eq_oprs);
266 List *grouping_columns,
267 List **constraintDeps);
Oid get_relation_idx_constraint_oid(Oid relationId, Oid indexId)
Oid CreateConstraintEntry(const char *constraintName, Oid constraintNamespace, char constraintType, bool isDeferrable, bool isDeferred, bool isValidated, Oid parentConstrId, Oid relId, const int16 *constraintKey, int constraintNKeys, int constraintNTotalKeys, Oid domainId, Oid indexRelId, Oid foreignRelId, const int16 *foreignKey, const Oid *pfEqOp, const Oid *ppEqOp, const Oid *ffEqOp, int foreignNKeys, char foreignUpdateType, char foreignDeleteType, char foreignMatchType, const Oid *exclOp, Node *conExpr, const char *conBin, bool conIsLocal, int conInhCount, bool conNoInherit, bool is_internal)
Bitmapset * get_relation_constraint_attnos(Oid relid, const char *conname, bool missing_ok, Oid *constraintOid)
CATALOG(pg_constraint, 2606, ConstraintRelationId)
bool ConstraintNameIsUsed(ConstraintCategory conCat, Oid objId, const char *conname)
void RenameConstraintById(Oid conId, const char *newname)
DECLARE_ARRAY_FOREIGN_KEY((confrelid, confkey), pg_attribute,(attrelid, attnum))
DECLARE_UNIQUE_INDEX_PKEY(pg_constraint_oid_index, 2667, on pg_constraint using btree(oid oid_ops))
bool ConstraintNameExists(const char *conname, Oid namespaceid)
Bitmapset * get_primary_key_attnos(Oid relid, bool deferrableOk, Oid *constraintOid)
DECLARE_INDEX(pg_constraint_conname_nsp_index, 2664, on pg_constraint using btree(conname name_ops, connamespace oid_ops))
void AlterConstraintNamespaces(Oid ownerId, Oid oldNspId, Oid newNspId, bool isType, ObjectAddresses *objsMoved)
#define BKI_LOOKUP_OPT(catalog)
void DeconstructFkConstraintRow(HeapTuple tuple, int *numfks, AttrNumber *conkey, AttrNumber *confkey, Oid *pf_eq_oprs, Oid *pp_eq_oprs, Oid *ff_eq_oprs)
Oid get_relation_constraint_oid(Oid relid, const char *conname, bool missing_ok)
#define BKI_LOOKUP(catalog)
DECLARE_UNIQUE_INDEX(pg_constraint_conrelid_contypid_conname_index, 2665, on pg_constraint using btree(conrelid oid_ops, contypid oid_ops, conname name_ops))
char * ChooseConstraintName(const char *name1, const char *name2, const char *label, Oid namespaceid, List *others)
void ConstraintSetParentConstraint(Oid childConstrId, Oid parentConstrId, Oid childTableId)
FormData_pg_constraint * Form_pg_constraint
Oid get_domain_constraint_oid(Oid typid, const char *conname, bool missing_ok)
DECLARE_ARRAY_FOREIGN_KEY_OPT((conrelid, conkey), pg_attribute,(attrelid, attnum))
void RemoveConstraintById(Oid conId)
bool check_functional_grouping(Oid relid, Index varno, Index varlevelsup, List *grouping_columns, List **constraintDeps)
DECLARE_TOAST(pg_constraint, 2832, 2833)