diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2019-01-14 19:25:19 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2019-01-14 19:25:19 -0300 |
commit | 74aa7e046e4a3927d506bc651261724539f67139 (patch) | |
tree | 08506b5c9416e9e22598ee2b1cb816bd2912816d /src/backend | |
parent | 20b4ed8d03047501cc28b600973564850bd1dd80 (diff) | |
download | postgresql-74aa7e046e4a3927d506bc651261724539f67139.tar.gz postgresql-74aa7e046e4a3927d506bc651261724539f67139.zip |
Fix unique INCLUDE indexes on partitioned tables
We were considering the INCLUDE columns as part of the key, allowing
unicity-violating rows to be inserted in different partitions.
Concurrent development conflict in eb7ed3f30634 and 8224de4f42cc.
Reported-by: Justin Pryzby
Discussion: https://postgr.es/m/20190109065109.GA4285@telsasoft.com
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/commands/indexcmds.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index 965b9f0d232..fec5bc5dd64 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -722,7 +722,7 @@ DefineIndex(Oid relationId, errdetail("%s constraints cannot be used when partition keys include expressions.", constraint_type))); - for (j = 0; j < indexInfo->ii_NumIndexAttrs; j++) + for (j = 0; j < indexInfo->ii_NumIndexKeyAttrs; j++) { if (key->partattrs[i] == indexInfo->ii_IndexAttrNumbers[j]) { |