Re: unique indexes on partitioned tables

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Jaime Casanova <jaime(dot)casanova(at)2ndquadrant(dot)com>
Cc: Jesper Pedersen <jesper(dot)pedersen(at)redhat(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: unique indexes on partitioned tables
Date: 2018-02-19 18:54:30
Message-ID: 20180219185430.bztdubmwhlceu6xs@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jaime Casanova wrote:

> Hi Álvaro,
>
> attached a tiny patch (on top of yours) that silence two "variables
> uninitilized" warnings.

Thanks! Applied.

> also noted that if you:
>
> """
> create table t1(i int) partition by hash (i);
> create table t1_0 partition of t1 for values with (modulus 2, remainder 0);
> create table t1_1 partition of t1 for values with (modulus 2, remainder 1);
> create unique index on t1(i);
> alter table t1 add primary key using index t1_i_idx ;
> """
>
> the ALTER TABLE ADD PK does not recurse to partitions, which maybe is
> perfectly fine because i'm using USING INDEX but it feels like an
> oversight to me

Ouch. Yeah, this is a bug. I'll try to come up with something.

--
Á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 Jesper Pedersen 2018-02-19 18:55:16 Re: JIT compiling with LLVM v10.1
Previous Message Fabien COELHO 2018-02-19 18:23:04 pgbench - test whether a variable exists