Re: unique, partitioned index fails to distinguish index key from INCLUDEd columns
Alvaro Herrera <alvherre@2ndquadrant.com>
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: pgsql-hackers@postgresql.org, Teodor Sigaev <teodor@sigaev.ru>
Date: 2019-01-14T22:31:07Z
Lists: pgsql-hackers
On 2019-Jan-09, Justin Pryzby wrote: > -- Fails to error > postgres=# CREATE UNIQUE INDEX ON t(j) INCLUDE(i); > > -- Fail to enforce uniqueness across partitions due to failure to enforce inclusion of partition key in index KEY > postgres=# INSERT INTO t VALUES(1,1); > postgres=# INSERT INTO t VALUES(2,1); Doh. Fix pushed. Commit 8224de4f42cc should have changed one appearance of ii_NumIndexAttrs to ii_NumIndexKeyAttrs, but because of the nature of concurrent development, nobody noticed. Thanks for reporting. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Fix unique INCLUDE indexes on partitioned tables
- 0ad41cf537ea 12.0 landed
- 74aa7e046e4a 11.2 landed
-
Indexes with INCLUDE columns and their support in B-tree
- 8224de4f42cc 11.0 cited
-
Allow UNIQUE indexes on partitioned tables
- eb7ed3f30634 11.0 cited