diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2018-02-19 16:59:37 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2018-02-19 17:40:00 -0300 |
commit | eb7ed3f3063401496e4aa4bd68fa33f0be31a72f (patch) | |
tree | c39b449716ed2a1c9fe20af363bdc049cf0b6a3e /src/include/parser/parse_utilcmd.h | |
parent | 524d64ea8e3e49b4fda41ff9b2f048b697384058 (diff) | |
download | postgresql-eb7ed3f3063401496e4aa4bd68fa33f0be31a72f.tar.gz postgresql-eb7ed3f3063401496e4aa4bd68fa33f0be31a72f.zip |
Allow UNIQUE indexes on partitioned tables
If we restrict unique constraints on partitioned tables so that they
must always include the partition key, then our standard approach to
unique indexes already works --- each unique key is forced to exist
within a single partition, so enforcing the unique restriction in each
index individually is enough to have it enforced globally. Therefore we
can implement unique indexes on partitions by simply removing a few
restrictions (and adding others.)
Discussion: https://postgr.es/m/20171222212921.hi6hg6pem2w2t36z@alvherre.pgsql
Discussion: https://postgr.es/m/20171229230607.3iib6b62fn3uaf47@alvherre.pgsql
Reviewed-by: Simon Riggs, Jesper Pedersen, Peter Eisentraut, Jaime
Casanova, Amit Langote
Diffstat (limited to 'src/include/parser/parse_utilcmd.h')
-rw-r--r-- | src/include/parser/parse_utilcmd.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/parser/parse_utilcmd.h b/src/include/parser/parse_utilcmd.h index 64aa8234e5f..35ac97940ad 100644 --- a/src/include/parser/parse_utilcmd.h +++ b/src/include/parser/parse_utilcmd.h @@ -29,6 +29,7 @@ extern PartitionBoundSpec *transformPartitionBound(ParseState *pstate, Relation PartitionBoundSpec *spec); extern IndexStmt *generateClonedIndexStmt(RangeVar *heapRel, Oid heapOid, Relation source_idx, - const AttrNumber *attmap, int attmap_length); + const AttrNumber *attmap, int attmap_length, + Oid *constraintOid); #endif /* PARSE_UTILCMD_H */ |