mirror of
https://github.com/postgres/postgres.git
synced 2025-10-29 22:49:41 +03:00
Foreign keys on partitioned tables
Author: Álvaro Herrera Discussion: https://postgr.es/m/20171231194359.cvojcour423ulha4@alvherre.pgsql Reviewed-by: Peter Eisentraut
This commit is contained in:
@@ -27,6 +27,19 @@ typedef enum ConstraintCategory
|
||||
CONSTRAINT_ASSERTION /* for future expansion */
|
||||
} ConstraintCategory;
|
||||
|
||||
/*
|
||||
* Used when cloning a foreign key constraint to a partition, so that the
|
||||
* caller can optionally set up a verification pass for it.
|
||||
*/
|
||||
typedef struct ClonedConstraint
|
||||
{
|
||||
Oid relid;
|
||||
Oid refrelid;
|
||||
Oid conindid;
|
||||
Oid conid;
|
||||
Constraint *constraint;
|
||||
} ClonedConstraint;
|
||||
|
||||
extern Oid CreateConstraintEntry(const char *constraintName,
|
||||
Oid constraintNamespace,
|
||||
char constraintType,
|
||||
@@ -57,6 +70,9 @@ extern Oid CreateConstraintEntry(const char *constraintName,
|
||||
bool conNoInherit,
|
||||
bool is_internal);
|
||||
|
||||
extern void CloneForeignKeyConstraints(Oid parentId, Oid relationId,
|
||||
List **cloned);
|
||||
|
||||
extern void RemoveConstraintById(Oid conId);
|
||||
extern void RenameConstraintById(Oid conId, const char *newname);
|
||||
|
||||
|
||||
@@ -74,6 +74,10 @@ extern void find_composite_type_dependencies(Oid typeOid,
|
||||
|
||||
extern void check_of_type(HeapTuple typetuple);
|
||||
|
||||
extern void createForeignKeyTriggers(Relation rel, Oid refRelOid,
|
||||
Constraint *fkconstraint, Oid constraintOid,
|
||||
Oid indexOid, bool create_action);
|
||||
|
||||
extern void register_on_commit_action(Oid relid, OnCommitAction action);
|
||||
extern void remove_on_commit_action(Oid relid);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user