Re: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT
Дата
Msg-id 3055.1547142109@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-bugs
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> On 2019-Jan-10, PG Bug reporting form wrote:
>> ALTER TABLE ONLY t1 ADD CONSTRAINT uniq_t1_i1_i2 UNIQUE (i1, i2);
>> [ leads to ]
>> Indexes:
>> "uniq_t1_i1_i2" UNIQUE CONSTRAINT, btree (i1, i2) INVALID

> I'm not clear what problem you're reporting.  If you use ONLY, then the
> command doesn't cascade to create the index on partitions, and the index
> is marked invalid.  If you add the constraint to each partition and
> ALTER INDEX ATTACH PARTITION, the index on t1 should become valid when
> every partition of the table has its index.

I concur that the code is operating as designed.  I think however that
there's a user-experience problem here, which is that INVALID suggests
that something's broken.  I wonder if we could improve matters by
making psql and the docs describe this state of a partitioned index
as INCOMPLETE.

            regards, tom lane


В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #15577: Query returns different results when executed multiple times
Следующее
От: Jesper Pedersen
Дата:
Сообщение: Re: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT