mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
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 ineb7ed3f306
and8224de4f42
. Reported-by: Justin Pryzby Discussion: https://postgr.es/m/20190109065109.GA4285@telsasoft.com
This commit is contained in:
@ -721,7 +721,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])
|
||||
{
|
||||
|
Reference in New Issue
Block a user