Re: pg_restore error with partitioned table having exclude constraint

From: Japin Li <japinli(at)hotmail(dot)com>
To: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Cc: Keith Paskett <keith(dot)paskett(at)logansw(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: pg_restore error with partitioned table having exclude constraint
Date: 2025-04-17 14:54:16
Message-ID: ME0P300MB0445ECCEBD36DD0843839E0FB6BC2@ME0P300MB0445.AUSP300.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, 17 Apr 2025 at 15:06, Álvaro Herrera <alvherre(at)kurilemu(dot)de> wrote:
> Hello,
>
> On 2025-Apr-16, Keith Paskett wrote:
>
>> A table partitioned by LIST with an exclusion constraint errors on
>> creating the constraint on the parent table when doing a
>> pg_dump/pg_restore
>
> Was this working previously?
>
> Thanks,

It seems PG 16 does not support exclusion constraints on partitioned tables.

[local]:2119558 postgres=# SELECT version();
version
-------------------------------------------------------------------------------------------------------
PostgreSQL 16.8 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0, 64-bit
(1 row)

[local]:2119558 postgres=# CREATE TABLE had_working_hist (context_id serial not null, had_person_id integer not null, active_tsr tstzrange not null) partition by LIST (context_id);
CREATE TABLE
[local]:2119558 postgres=# ALTER TABLE had_working_hist ADD CONSTRAINT had_working_hist_tsr_excl EXCLUDE USING btree (context_id WITH =, had_person_id WITH =);
ERROR: exclusion constraints are not supported on partitioned tables
LINE 1: ALTER TABLE had_working_hist ADD CONSTRAINT had_working_hist...
^

--
Regrads,
Japin Li

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Álvaro Herrera 2025-04-17 15:18:36 Re: pg_restore error with partitioned table having exclude constraint
Previous Message Álvaro Herrera 2025-04-17 13:06:03 Re: pg_restore error with partitioned table having exclude constraint