Re: unique, partitioned index fails to distinguish index key from INCLUDEd columns

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Teodor Sigaev <teodor(at)sigaev(dot)ru>
Subject: Re: unique, partitioned index fails to distinguish index key from INCLUDEd columns
Date: 2019-01-14 22:31:07
Message-ID: 201901142231.tbnjmhllnptv@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2019-01-14 22:34:09 Re: [HACKERS] Surjective functional indexes
Previous Message Tom Lane 2019-01-14 22:24:56 Re: hostorder and failover_timeout for libpq