#include "catalog/pg_collation.h"
#include "catalog/pg_collation_fn.h"
#include "catalog/pg_constraint.h"
+#include "catalog/pg_constraint_fn.h"
#include "catalog/pg_conversion.h"
#include "catalog/pg_conversion_fn.h"
#include "catalog/pg_database.h"
#include "catalog/pg_attrdef.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_constraint.h"
+#include "catalog/pg_constraint_fn.h"
#include "catalog/pg_foreign_table.h"
#include "catalog/pg_inherits.h"
#include "catalog/pg_namespace.h"
#include "catalog/pg_am.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_constraint.h"
+#include "catalog/pg_constraint_fn.h"
#include "catalog/pg_operator.h"
#include "catalog/pg_opclass.h"
#include "catalog/pg_tablespace.h"
#include "catalog/pg_event_trigger.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_constraint.h"
+#include "catalog/pg_constraint_fn.h"
#include "catalog/pg_conversion.h"
#include "catalog/pg_database.h"
#include "catalog/pg_extension.h"
#include "catalog/indexing.h"
#include "catalog/objectaccess.h"
#include "catalog/pg_constraint.h"
+#include "catalog/pg_constraint_fn.h"
#include "catalog/pg_operator.h"
#include "catalog/pg_type.h"
#include "commands/defrem.h"
#include "catalog/pg_am.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_constraint.h"
+#include "catalog/pg_constraint_fn.h"
#include "catalog/pg_depend.h"
#include "catalog/pg_foreign_table.h"
#include "catalog/pg_inherits.h"
#include "catalog/indexing.h"
#include "catalog/objectaccess.h"
#include "catalog/pg_constraint.h"
+#include "catalog/pg_constraint_fn.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_trigger.h"
#include "catalog/pg_type.h"
#include "catalog/pg_authid.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_constraint.h"
+#include "catalog/pg_constraint_fn.h"
#include "catalog/pg_depend.h"
#include "catalog/pg_enum.h"
#include "catalog/pg_language.h"
#include "postgres.h"
#include "catalog/pg_aggregate.h"
-#include "catalog/pg_constraint.h"
+#include "catalog/pg_constraint_fn.h"
#include "catalog/pg_type.h"
#include "nodes/makefuncs.h"
#include "nodes/nodeFuncs.h"
#include "catalog/catalog.h"
#include "catalog/heap.h"
#include "catalog/pg_am.h"
-#include "catalog/pg_constraint.h"
+#include "catalog/pg_constraint_fn.h"
#include "catalog/pg_type.h"
#include "commands/defrem.h"
#include "nodes/makefuncs.h"
#include "catalog/pg_am.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_constraint.h"
+#include "catalog/pg_constraint_fn.h"
#include "catalog/pg_opclass.h"
#include "catalog/pg_operator.h"
#include "catalog/pg_type.h"
#define PG_CONSTRAINT_H
#include "catalog/genbki.h"
-#include "catalog/dependency.h"
-#include "nodes/pg_list.h"
/* ----------------
* pg_constraint definition. cpp turns this into
#define Anum_pg_constraint_conbin 23
#define Anum_pg_constraint_consrc 24
+/* ----------------
+ * initial contents of pg_constraint
+ * ----------------
+ */
+
+/* nothing, at present */
+
/* Valid values for contype */
#define CONSTRAINT_CHECK 'c'
* the FKCONSTR_MATCH_xxx constants defined in parsenodes.h.
*/
-/*
- * Identify constraint type for lookup purposes
- */
-typedef enum ConstraintCategory
-{
- CONSTRAINT_RELATION,
- CONSTRAINT_DOMAIN,
- CONSTRAINT_ASSERTION /* for future expansion */
-} ConstraintCategory;
-
-/*
- * prototypes for functions in pg_constraint.c
- */
-extern Oid CreateConstraintEntry(const char *constraintName,
- Oid constraintNamespace,
- char constraintType,
- bool isDeferrable,
- bool isDeferred,
- bool isValidated,
- Oid relId,
- const int16 *constraintKey,
- int constraintNKeys,
- 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,
- const char *conSrc,
- bool conIsLocal,
- int conInhCount,
- bool conNoInherit,
- bool is_internal);
-
-extern void RemoveConstraintById(Oid conId);
-extern void RenameConstraintById(Oid conId, const char *newname);
-extern void SetValidatedConstraintById(Oid conId);
-
-extern bool ConstraintNameIsUsed(ConstraintCategory conCat, Oid objId,
- Oid objNamespace, const char *conname);
-extern char *ChooseConstraintName(const char *name1, const char *name2,
- const char *label, Oid namespaceid,
- List *others);
-
-extern void AlterConstraintNamespaces(Oid ownerId, Oid oldNspId,
- Oid newNspId, bool isType, ObjectAddresses *objsMoved);
-extern Oid get_relation_constraint_oid(Oid relid, const char *conname, bool missing_ok);
-extern Oid get_domain_constraint_oid(Oid typid, const char *conname, bool missing_ok);
-
-extern bool check_functional_grouping(Oid relid,
- Index varno, Index varlevelsup,
- List *grouping_columns,
- List **constraintDeps);
-
#endif /* PG_CONSTRAINT_H */
--- /dev/null
+/*-------------------------------------------------------------------------
+ *
+ * pg_constraint_fn.h
+ * prototypes for functions in catalog/pg_constraint.c
+ *
+ *
+ * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/catalog/pg_constraint_fn.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PG_CONSTRAINT_FN_H
+#define PG_CONSTRAINT_FN_H
+
+#include "catalog/dependency.h"
+#include "nodes/pg_list.h"
+
+/*
+ * Identify constraint type for lookup purposes
+ */
+typedef enum ConstraintCategory
+{
+ CONSTRAINT_RELATION,
+ CONSTRAINT_DOMAIN,
+ CONSTRAINT_ASSERTION /* for future expansion */
+} ConstraintCategory;
+
+extern Oid CreateConstraintEntry(const char *constraintName,
+ Oid constraintNamespace,
+ char constraintType,
+ bool isDeferrable,
+ bool isDeferred,
+ bool isValidated,
+ Oid relId,
+ const int16 *constraintKey,
+ int constraintNKeys,
+ 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,
+ const char *conSrc,
+ bool conIsLocal,
+ int conInhCount,
+ bool conNoInherit,
+ bool is_internal);
+
+extern void RemoveConstraintById(Oid conId);
+extern void RenameConstraintById(Oid conId, const char *newname);
+extern void SetValidatedConstraintById(Oid conId);
+
+extern bool ConstraintNameIsUsed(ConstraintCategory conCat, Oid objId,
+ Oid objNamespace, const char *conname);
+extern char *ChooseConstraintName(const char *name1, const char *name2,
+ const char *label, Oid namespaceid,
+ List *others);
+
+extern void AlterConstraintNamespaces(Oid ownerId, Oid oldNspId,
+ Oid newNspId, bool isType, ObjectAddresses *objsMoved);
+extern Oid get_relation_constraint_oid(Oid relid, const char *conname, bool missing_ok);
+extern Oid get_domain_constraint_oid(Oid typid, const char *conname, bool missing_ok);
+
+extern bool check_functional_grouping(Oid relid,
+ Index varno, Index varlevelsup,
+ List *grouping_columns,
+ List **constraintDeps);
+
+#endif /* PG_CONSTRAINT_FN_H */