agora inbox for pgsql-bugs@postgresql.org  
help / color / mirror / Atom feed
pg_restore error with partitioned table having exclude constraint
15+ messages / 4 participants
[nested] [flat]

* pg_restore error with partitioned table having exclude constraint
@ 2025-04-17 05:11 Keith Paskett <keith.paskett@logansw.com>
  2025-04-17 11:06 ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-17 13:06 ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  0 siblings, 2 replies; 15+ messages in thread

From: Keith Paskett @ 2025-04-17 05:11 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org

Postgresql 17.4

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


ERROR:
pg_restore: error: could not execute query: ERROR:  cannot attach index "pkg708_had_working_hist_context_id_had_person_id_active_ts_excl" as a partition of index "had_working_hist_tsr_excl"
DETAIL:  The index definitions do not match.
Command was: ALTER INDEX apps.had_working_hist_tsr_excl ATTACH PARTITION apps_part.pkg708_had_working_hist_context_id_had_person_id_active_ts_excl;


TABLE AFTER pg_restore
\d+ apps.had_working_hist
                                                                  Partitioned table "apps.had_working_hist"
       Column        |           Type           | Collation | Nullable |                    Default                     | Storage  | Compression | Stats target | Description 
---------------------+--------------------------+-----------+----------+------------------------------------------------+----------+-------------+--------------+-------------
 had_working_hist_id | integer                  |           | not null | nextval('apps.had_working_hist_seq'::regclass) | plain    |             |              | 
 context_id          | integer                  |           | not null |                                                | plain    |             |              | 
 had_person_id       | integer                  |           | not null |                                                | plain    |             |              | 
 comment             | text                     |           |          |                                                | extended |             |              | 
 active_tsr          | tstzrange                |           | not null |                                                | extended |             |              | 
 add_tstz            | timestamp with time zone |           | not null | CURRENT_TIMESTAMP                              | plain    |             |              | 
 add_by_id           | integer                  |           | not null |                                                | plain    |             |              | 
 mod_tstz            | timestamp with time zone |           | not null | CURRENT_TIMESTAMP                              | plain    |             |              | 
 mod_by_id           | integer                  |           | not null |                                                | plain    |             |              | 
Partition key: LIST (context_id)
Indexes:
    "had_working_hist_pkey" PRIMARY KEY, btree (had_working_hist_id, context_id)
    "had_working_hist_add_by_id_idx" btree (add_by_id)
    "had_working_hist_had_person_id_idx" btree (had_person_id)
    "had_working_hist_mod_by_id_idx" btree (mod_by_id)
    "had_working_hist_tsr_excl" EXCLUDE USING gist (context_id WITH =, had_person_id WITH =, active_tsr WITH &&) INVALID
Foreign-key constraints:
    "had_working_hist__add_by_id_fk" FOREIGN KEY (add_by_id) REFERENCES persons(person_id)
    "had_working_hist__context_id_fk" FOREIGN KEY (context_id) REFERENCES apm_packages(package_id)
    "had_working_hist__had_person_id_fk" FOREIGN KEY (had_person_id, context_id) REFERENCES apps.had_person(had_person_id, context_id)
    "had_working_hist__mod_by_id_fk" FOREIGN KEY (mod_by_id) REFERENCES persons(person_id)
Partitions: apps_part.pkg708_had_working_hist FOR VALUES IN (708)


Keith Paskett
Founder/Software Engineer
41 E 400 N, Suite 334
Logan, UT 84321
435-535-3678



Attachments:

  [image/png] Logo-scl.png (7.1K, ../../2A40921D-83AB-411E-ADA6-7E509A46F1E4@logansw.com/3-Logo-scl.png)
  download | view image

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: pg_restore error with partitioned table having exclude constraint
  2025-04-17 05:11 pg_restore error with partitioned table having exclude constraint Keith Paskett <keith.paskett@logansw.com>
@ 2025-04-17 11:06 ` Japin Li <japinli@hotmail.com>
  1 sibling, 0 replies; 15+ messages in thread

From: Japin Li @ 2025-04-17 11:06 UTC (permalink / raw)
  To: Keith Paskett <keith.paskett@logansw.com>; +Cc: pgsql-bugs@lists.postgresql.org

On Wed, 16 Apr 2025 at 23:11, Keith Paskett <keith.paskett@logansw.com> wrote:
> Postgresql 17.4
>
> 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
>
> ERROR:
>
> pg_restore: error: could not execute query: ERROR:  cannot attach index
> "pkg708_had_working_hist_context_id_had_person_id_active_ts_excl" as a partition of index "had_working_hist_tsr_excl"
>
> DETAIL:  The index definitions do not match.
>
> Command was: ALTER INDEX apps.had_working_hist_tsr_excl ATTACH PARTITION
> apps_part.pkg708_had_working_hist_context_id_had_person_id_active_ts_excl;
>
> TABLE AFTER pg_restore
>
> \d+ apps.had_working_hist
>
>                                                                   Partitioned table "apps.had_working_hist"
>
>        Column        |           Type           | Collation | Nullable |                    Default                     |
> Storage  | Compression | Stats target | Description 
>
> ---------------------+--------------------------+-----------+----------+------------------------------------------------+----------+-------------+--------------+-------------
>
>
>  had_working_hist_id | integer                  |           | not null | nextval('apps.had_working_hist_seq'::regclass) |
> plain    |             |              | 
>
>  context_id          | integer                  |           | not null |                                                |
> plain    |             |              | 
>
>  had_person_id       | integer                  |           | not null |                                                |
> plain    |             |              | 
>
>  comment             | text                     |           |          |                                                |
> extended |             |              | 
>
>  active_tsr          | tstzrange                |           | not null |                                                |
> extended |             |              | 
>
>  add_tstz            | timestamp with time zone |           | not null | CURRENT_TIMESTAMP                              |
> plain    |             |              | 
>
>  add_by_id           | integer                  |           | not null |                                                |
> plain    |             |              | 
>
>  mod_tstz            | timestamp with time zone |           | not null | CURRENT_TIMESTAMP                              |
> plain    |             |              | 
>
>  mod_by_id           | integer                  |           | not null |                                                |
> plain    |             |              | 
>
> Partition key: LIST (context_id)
>
> Indexes:
>
>     "had_working_hist_pkey" PRIMARY KEY, btree (had_working_hist_id, context_id)
>
>     "had_working_hist_add_by_id_idx" btree (add_by_id)
>
>     "had_working_hist_had_person_id_idx" btree (had_person_id)
>
>     "had_working_hist_mod_by_id_idx" btree (mod_by_id)
>
>     "had_working_hist_tsr_excl" EXCLUDE USING gist (context_id WITH =, had_person_id WITH =, active_tsr WITH &&) INVALID
>
> Foreign-key constraints:
>
>     "had_working_hist__add_by_id_fk" FOREIGN KEY (add_by_id) REFERENCES persons(person_id)
>
>     "had_working_hist__context_id_fk" FOREIGN KEY (context_id) REFERENCES apm_packages(package_id)
>
>     "had_working_hist__had_person_id_fk" FOREIGN KEY (had_person_id, context_id) REFERENCES apps.had_person
> (had_person_id, context_id)
>
>     "had_working_hist__mod_by_id_fk" FOREIGN KEY (mod_by_id) REFERENCES persons(person_id)
>
> Partitions: apps_part.pkg708_had_working_hist FOR VALUES IN (708)
>

Hi, Keith

I can replicate this issue on the current master branch. After some investigation,
I found the following code at the end of the CompareIndexInfo() function:

    /* No support currently for comparing exclusion indexes. */
    if (info1->ii_ExclusionOps != NULL || info2->ii_ExclusionOps != NULL)
        return false;

I believe this is why the exclusion index is rejected.  Commit 8b08f7d482
introduces a change that disables the creation of exclusion constraints on
partitioned tables, while commit 8c852ba9a4 allows some exclusion consistency
on partitions.

Here is a patch to fix it.  It just compares the OIDs of two exclusion constraints.


-- 
Regrads,
Japin Li

Attachments:

  [text/x-diff] compare-exclusion-index-info.patch (720B, ../../ME0P300MB0445F93240E1311A2DB1269AB6BC2@ME0P300MB0445.AUSP300.PROD.OUTLOOK.COM/2-compare-exclusion-index-info.patch)
  download | inline diff:
diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 739a92bdcc1..5b00047a290 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -2645,9 +2645,15 @@ CompareIndexInfo(const IndexInfo *info1, const IndexInfo *info2,
 			return false;
 	}
 
-	/* No support currently for comparing exclusion indexes. */
-	if (info1->ii_ExclusionOps != NULL || info2->ii_ExclusionOps != NULL)
+	if ((info1->ii_ExclusionOps == NULL) != (info2->ii_ExclusionOps == NULL))
 		return false;
+	if (info1->ii_ExclusionOps != NULL)
+	{
+		for (i = 0; i < info1->ii_NumIndexAttrs; i++) {
+			if (info1->ii_ExclusionOps[i] != info2->ii_ExclusionOps[i])
+				return false;
+		}
+	}
 
 	return true;
 }

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: pg_restore error with partitioned table having exclude constraint
  2025-04-17 05:11 pg_restore error with partitioned table having exclude constraint Keith Paskett <keith.paskett@logansw.com>
@ 2025-04-17 13:06 ` Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-17 14:54   ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  1 sibling, 1 reply; 15+ messages in thread

From: Álvaro Herrera @ 2025-04-17 13:06 UTC (permalink / raw)
  To: Keith Paskett <keith.paskett@logansw.com>; +Cc: pgsql-bugs@lists.postgresql.org

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,

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/





^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: pg_restore error with partitioned table having exclude constraint
  2025-04-17 05:11 pg_restore error with partitioned table having exclude constraint Keith Paskett <keith.paskett@logansw.com>
  2025-04-17 13:06 ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
@ 2025-04-17 14:54   ` Japin Li <japinli@hotmail.com>
  2025-04-17 15:18     ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  0 siblings, 1 reply; 15+ messages in thread

From: Japin Li @ 2025-04-17 14:54 UTC (permalink / raw)
  To: Álvaro Herrera <alvherre@kurilemu.de>; +Cc: Keith Paskett <keith.paskett@logansw.com>; pgsql-bugs@lists.postgresql.org

On Thu, 17 Apr 2025 at 15:06, Álvaro Herrera <alvherre@kurilemu.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





^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: pg_restore error with partitioned table having exclude constraint
  2025-04-17 05:11 pg_restore error with partitioned table having exclude constraint Keith Paskett <keith.paskett@logansw.com>
  2025-04-17 13:06 ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-17 14:54   ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
@ 2025-04-17 15:18     ` Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-17 19:03       ` Re: pg_restore error with partitioned table having exclude constraint Keith Paskett <keith.paskett@logansw.com>
  2025-04-24 15:07       ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  0 siblings, 2 replies; 15+ messages in thread

From: Álvaro Herrera @ 2025-04-17 15:18 UTC (permalink / raw)
  To: Japin Li <japinli@hotmail.com>; +Cc: Keith Paskett <keith.paskett@logansw.com>; pgsql-bugs@lists.postgresql.org

On 2025-Apr-17, Japin Li wrote:

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

Yeah, my recollection is that they were purposefully disallowed (mainly
because I didn't want to research how to fully make them work when
adding local partitioned indexes), and that we needed to do more work if
we wanted to let them through.  I suspect commit 8c852ba9a4 was mistaken
to allow that case without looking for further implications.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"On the other flipper, one wrong move and we're Fatal Exceptions"
(T.U.X.: Term Unit X  - http://www.thelinuxreview.com/TUX/)





^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: pg_restore error with partitioned table having exclude constraint
  2025-04-17 05:11 pg_restore error with partitioned table having exclude constraint Keith Paskett <keith.paskett@logansw.com>
  2025-04-17 13:06 ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-17 14:54   ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-17 15:18     ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
@ 2025-04-17 19:03       ` Keith Paskett <keith.paskett@logansw.com>
  1 sibling, 0 replies; 15+ messages in thread

From: Keith Paskett @ 2025-04-17 19:03 UTC (permalink / raw)
  To: Álvaro Herrera <alvherre@kurilemu.de>; +Cc: Japin Li <japinli@hotmail.com>; pgsql-bugs@lists.postgresql.org

I’m pretty sure that I saw support for exclusion constraints in the PG17 release notes,
and added them to tables that weren’t able to use them in PG16.

They worked great. I just discovered the issue with pg_dump/pg_restore.
The restored tables actually still work because the partition tables have the proper constraint.
Even new partition tables created after the pg_restore get the correct constraint.

Can I assume that the patch will get incorporated into a future release,
and not that exclusion constraints on partition tables will be disallowed?

-Keith


> On Apr 17, 2025, at 9:18 AM, Álvaro Herrera <alvherre@kurilemu.de> wrote:
> 
> On 2025-Apr-17, Japin Li wrote:
> 
>> It seems PG 16 does not support exclusion constraints on partitioned tables.
> 
> Yeah, my recollection is that they were purposefully disallowed (mainly
> because I didn't want to research how to fully make them work when
> adding local partitioned indexes), and that we needed to do more work if
> we wanted to let them through.  I suspect commit 8c852ba9a4 was mistaken
> to allow that case without looking for further implications.
> 
> -- 
> Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
> "On the other flipper, one wrong move and we're Fatal Exceptions"
> (T.U.X.: Term Unit X  - http://www.thelinuxreview.com/TUX/)

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: pg_restore error with partitioned table having exclude constraint
  2025-04-17 05:11 pg_restore error with partitioned table having exclude constraint Keith Paskett <keith.paskett@logansw.com>
  2025-04-17 13:06 ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-17 14:54   ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-17 15:18     ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
@ 2025-04-24 15:07       ` Japin Li <japinli@hotmail.com>
  2025-04-28 08:42         ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  1 sibling, 1 reply; 15+ messages in thread

From: Japin Li @ 2025-04-24 15:07 UTC (permalink / raw)
  To: Álvaro Herrera <alvherre@kurilemu.de>; +Cc: Keith Paskett <keith.paskett@logansw.com>; pgsql-bugs@lists.postgresql.org

On Thu, 17 Apr 2025 at 17:18, Álvaro Herrera <alvherre@kurilemu.de> wrote:
> On 2025-Apr-17, Japin Li wrote:
>
>> It seems PG 16 does not support exclusion constraints on partitioned tables.
>
> Yeah, my recollection is that they were purposefully disallowed (mainly
> because I didn't want to research how to fully make them work when
> adding local partitioned indexes), and that we needed to do more work if
> we wanted to let them through.  I suspect commit 8c852ba9a4 was mistaken
> to allow that case without looking for further implications.
>

Sorry, I’m unclear on “more work.” Can you explain further?

-- 
Regrads,
Japin Li





^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: pg_restore error with partitioned table having exclude constraint
  2025-04-17 05:11 pg_restore error with partitioned table having exclude constraint Keith Paskett <keith.paskett@logansw.com>
  2025-04-17 13:06 ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-17 14:54   ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-17 15:18     ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-24 15:07       ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
@ 2025-04-28 08:42         ` Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-29 14:44           ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  0 siblings, 1 reply; 15+ messages in thread

From: Álvaro Herrera @ 2025-04-28 08:42 UTC (permalink / raw)
  To: Japin Li <japinli@hotmail.com>; +Cc: Keith Paskett <keith.paskett@logansw.com>; pgsql-bugs@lists.postgresql.org

On 2025-Apr-24, Japin Li wrote:

> On Thu, 17 Apr 2025 at 17:18, Álvaro Herrera <alvherre@kurilemu.de> wrote:
> > On 2025-Apr-17, Japin Li wrote:
> >
> >> It seems PG 16 does not support exclusion constraints on
> >> partitioned tables.
> >
> > Yeah, my recollection is that they were purposefully disallowed
> > (mainly because I didn't want to research how to fully make them
> > work when adding local partitioned indexes), and that we needed to
> > do more work if we wanted to let them through.  I suspect commit
> > 8c852ba9a4 was mistaken to allow that case without looking for
> > further implications.
> 
> Sorry, I’m unclear on “more work.” Can you explain further?

Well, there are no tests in the patch.  8c852ba9a434 added some, but
it's now clear that something was overlooked.  I think this patch should
make more of an effort to cover all interesting cases in regression
tests if there are holes in coverage; and also add something to verify
that pg_dump and pg_upgrade work correctly for these constraints.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"Si quieres ser creativo, aprende el arte de perder el tiempo"





^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: pg_restore error with partitioned table having exclude constraint
  2025-04-17 05:11 pg_restore error with partitioned table having exclude constraint Keith Paskett <keith.paskett@logansw.com>
  2025-04-17 13:06 ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-17 14:54   ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-17 15:18     ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-24 15:07       ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-28 08:42         ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
@ 2025-04-29 14:44           ` Japin Li <japinli@hotmail.com>
  2025-04-29 14:53             ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  0 siblings, 1 reply; 15+ messages in thread

From: Japin Li @ 2025-04-29 14:44 UTC (permalink / raw)
  To: Álvaro Herrera <alvherre@kurilemu.de>; +Cc: Keith Paskett <keith.paskett@logansw.com>; pgsql-bugs@lists.postgresql.org

On Mon, 28 Apr 2025 at 10:42, Álvaro Herrera <alvherre@kurilemu.de> wrote:
> On 2025-Apr-24, Japin Li wrote:
>
>> On Thu, 17 Apr 2025 at 17:18, Álvaro Herrera <alvherre@kurilemu.de> wrote:
>> > On 2025-Apr-17, Japin Li wrote:
>> >
>> >> It seems PG 16 does not support exclusion constraints on
>> >> partitioned tables.
>> >
>> > Yeah, my recollection is that they were purposefully disallowed
>> > (mainly because I didn't want to research how to fully make them
>> > work when adding local partitioned indexes), and that we needed to
>> > do more work if we wanted to let them through.  I suspect commit
>> > 8c852ba9a4 was mistaken to allow that case without looking for
>> > further implications.
>> 
>> Sorry, I’m unclear on “more work.” Can you explain further?
>
> Well, there are no tests in the patch.  8c852ba9a434 added some, but
> it's now clear that something was overlooked.  I think this patch should
> make more of an effort to cover all interesting cases in regression
> tests if there are holes in coverage; and also add something to verify
> that pg_dump and pg_upgrade work correctly for these constraints.
>

My understanding, based on the src/bin/pg_dump tests, is that they don't
involve a genuine restore of the dumped data to a database.  Instead, it
dumps to a file using pg_restore.   Is that correct?

I doubt whether I can add a test to pg_dump that would cover this issue.

-- 
Regrads,
Japin Li





^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: pg_restore error with partitioned table having exclude constraint
  2025-04-17 05:11 pg_restore error with partitioned table having exclude constraint Keith Paskett <keith.paskett@logansw.com>
  2025-04-17 13:06 ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-17 14:54   ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-17 15:18     ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-24 15:07       ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-28 08:42         ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-29 14:44           ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
@ 2025-04-29 14:53             ` Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-30 06:38               ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  0 siblings, 1 reply; 15+ messages in thread

From: Álvaro Herrera @ 2025-04-29 14:53 UTC (permalink / raw)
  To: Japin Li <japinli@hotmail.com>; +Cc: Keith Paskett <keith.paskett@logansw.com>; pgsql-bugs@lists.postgresql.org

On 2025-Apr-29, Japin Li wrote:

> My understanding, based on the src/bin/pg_dump tests, is that they don't
> involve a genuine restore of the dumped data to a database.  Instead, it
> dumps to a file using pg_restore.   Is that correct?

Yes.

> I doubt whether I can add a test to pg_dump that would cover this issue.

The pg_upgrade now includes a roundtrip dump/restore which you can take
advantage of.  You just need to ensure some of the src/test/regress/sql
files leave an object in the state you need, and the pg_upgrade test
will run those tests and try to dump and restore the resulting database.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"Debido a que la velocidad de la luz es mucho mayor que la del sonido,
 algunas personas nos parecen brillantes un minuto antes
 de escuchar las pelotudeces que dicen." (Roberto Fontanarrosa)





^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: pg_restore error with partitioned table having exclude constraint
  2025-04-17 05:11 pg_restore error with partitioned table having exclude constraint Keith Paskett <keith.paskett@logansw.com>
  2025-04-17 13:06 ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-17 14:54   ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-17 15:18     ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-24 15:07       ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-28 08:42         ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-29 14:44           ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-29 14:53             ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
@ 2025-04-30 06:38               ` Japin Li <japinli@hotmail.com>
  2025-04-30 10:45                 ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  0 siblings, 1 reply; 15+ messages in thread

From: Japin Li @ 2025-04-30 06:38 UTC (permalink / raw)
  To: Álvaro Herrera <alvherre@kurilemu.de>; +Cc: Keith Paskett <keith.paskett@logansw.com>; pgsql-bugs@lists.postgresql.org

On Tue, 29 Apr 2025 at 16:53, Álvaro Herrera <alvherre@kurilemu.de> wrote:
> On 2025-Apr-29, Japin Li wrote:
>
>> My understanding, based on the src/bin/pg_dump tests, is that they don't
>> involve a genuine restore of the dumped data to a database.  Instead, it
>> dumps to a file using pg_restore.   Is that correct?
>
> Yes.
>
>> I doubt whether I can add a test to pg_dump that would cover this issue.
>
> The pg_upgrade now includes a roundtrip dump/restore which you can take
> advantage of.  You just need to ensure some of the src/test/regress/sql
> files leave an object in the state you need, and the pg_upgrade test
> will run those tests and try to dump and restore the resulting database.
>

Thank you for the explanation. A test case has been added to create_index.sql.
Could you please take a look?

-- 
Regrads,
Japin Li

Attachments:

  [text/x-diff] restore-partitioned-tables-with-exclude-constraints.patch (2.3K, ../../ME0P300MB0445A5BF45A46CC72B39C580B6832@ME0P300MB0445.AUSP300.PROD.OUTLOOK.COM/2-restore-partitioned-tables-with-exclude-constraints.patch)
  download | inline diff:
diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 739a92bdcc1..f8a40140123 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -2645,9 +2645,16 @@ CompareIndexInfo(const IndexInfo *info1, const IndexInfo *info2,
 			return false;
 	}
 
-	/* No support currently for comparing exclusion indexes. */
-	if (info1->ii_ExclusionOps != NULL || info2->ii_ExclusionOps != NULL)
+	if (((info1->ii_ExclusionOps == NULL) != (info2->ii_ExclusionOps == NULL)))
 		return false;
+	if (info1->ii_ExclusionOps != NULL)
+	{
+		for (i = 0; i < info1->ii_NumIndexAttrs; i++)
+		{
+			if (info1->ii_ExclusionOps[i] != info2->ii_ExclusionOps[i])
+				return false;
+		}
+	}
 
 	return true;
 }
diff --git a/src/test/regress/expected/create_index.out b/src/test/regress/expected/create_index.out
index 9ade7b835e6..395c55b0b35 100644
--- a/src/test/regress/expected/create_index.out
+++ b/src/test/regress/expected/create_index.out
@@ -3482,6 +3482,13 @@ SELECT * FROM bitmap_split_or WHERE a = 1 AND (b = 1 OR b = 2) AND c = 2;
 
 DROP TABLE bitmap_split_or;
 --
+-- Test restoring partitioned tables with exclude constraints.
+-- Do not drop these tables; they are used in pg_upgrade tests.
+--
+CREATE TABLE regress_table_excl (id int, data int) PARTITION BY LIST (id);
+ALTER TABLE regress_table_excl ADD EXCLUDE USING btree(id WITH =, data WITH =);
+CREATE TABLE regress_table_excl_1 PARTITION OF regress_table_excl FOR VALUES IN (1);
+--
 -- REINDEX SCHEMA
 --
 REINDEX SCHEMA schema_to_reindex; -- failure, schema does not exist
diff --git a/src/test/regress/sql/create_index.sql b/src/test/regress/sql/create_index.sql
index e21ff426519..25ba64cc3f5 100644
--- a/src/test/regress/sql/create_index.sql
+++ b/src/test/regress/sql/create_index.sql
@@ -1451,6 +1451,14 @@ EXPLAIN (COSTS OFF)
 SELECT * FROM bitmap_split_or WHERE a = 1 AND (b = 1 OR b = 2) AND c = 2;
 DROP TABLE bitmap_split_or;
 
+--
+-- Test restoring partitioned tables with exclude constraints.
+-- Do not drop these tables; they are used in pg_upgrade tests.
+--
+CREATE TABLE regress_table_excl (id int, data int) PARTITION BY LIST (id);
+ALTER TABLE regress_table_excl ADD EXCLUDE USING btree(id WITH =, data WITH =);
+CREATE TABLE regress_table_excl_1 PARTITION OF regress_table_excl FOR VALUES IN (1);
+
 --
 -- REINDEX SCHEMA
 --

^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: pg_restore error with partitioned table having exclude constraint
  2025-04-17 05:11 pg_restore error with partitioned table having exclude constraint Keith Paskett <keith.paskett@logansw.com>
  2025-04-17 13:06 ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-17 14:54   ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-17 15:18     ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-24 15:07       ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-28 08:42         ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-29 14:44           ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-29 14:53             ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-30 06:38               ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
@ 2025-04-30 10:45                 ` Álvaro Herrera <alvherre@kurilemu.de>
  2025-05-14 11:10                   `  回复: pg_restore error with partitioned table having exclude constraint Li Japin <japinli@hotmail.com>
  0 siblings, 1 reply; 15+ messages in thread

From: Álvaro Herrera @ 2025-04-30 10:45 UTC (permalink / raw)
  To: Japin Li <japinli@hotmail.com>; +Cc: Keith Paskett <keith.paskett@logansw.com>; pgsql-bugs@lists.postgresql.org

On 2025-Apr-30, Japin Li wrote:

> Thank you for the explanation. A test case has been added to create_index.sql.
> Could you please take a look?

Well, it seems a bit minimalistic -- I would try to be more adversarial
about it maybe, because details are where devil(s) lie.

You need to add comments in CompareIndexInfo about your new code.  Why
is it okay to ignore ii_ExclusionProcs and ii_ExclusionStrats?  Why is
it okay to not have tests that set up tables with those things as
different so that this function returns false in these cases?  Why do
you have a test for a table set up where the positive case is handled,
but no case for the negative case?

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/





^ permalink  raw  reply  [nested|flat] 15+ messages in thread

*  回复: pg_restore error with partitioned table having exclude constraint
  2025-04-17 05:11 pg_restore error with partitioned table having exclude constraint Keith Paskett <keith.paskett@logansw.com>
  2025-04-17 13:06 ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-17 14:54   ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-17 15:18     ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-24 15:07       ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-28 08:42         ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-29 14:44           ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-29 14:53             ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-30 06:38               ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-30 10:45                 ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
@ 2025-05-14 11:10                   ` Li Japin <japinli@hotmail.com>
  2026-07-20 15:34                     ` Re: 回复: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  0 siblings, 1 reply; 15+ messages in thread

From: Li Japin @ 2025-05-14 11:10 UTC (permalink / raw)
  To: Álvaro Herrera <alvherre@kurilemu.de>; +Cc: Keith Paskett <keith.paskett@logansw.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>; songjinzhou <tsinghualucky912@foxmail.com>

On 2025-Apr-30, Álvaro Herrera wrote:
> On 2025-Apr-30, Japin Li wrote:
>
>> Thank you for the explanation. A test case has been added to create_index.sql.
>> Could you please take a look?
>
> Well, it seems a bit minimalistic -- I would try to be more adversarial
> about it maybe, because details are where devil(s) lie.
>
> You need to add comments in CompareIndexInfo about your new code.  Why
> Is it okay to ignore ii_ExclusionProcs and ii_ExclusionStrats?  Why is
> it okay to not have tests that set up tables with those things as
> different so that this function returns false in these cases?  Why do
> you have a test for a table set up where the positive case is handled,
> but no case for the negative case?

Apologies for the delay.  Considering it further, ignoring ii_ExclusionProcs and
ii_ExclusionStrats seems incorrect given custom operators.

I've also updated ii_NumIndexAttrs to ii_NumIndexKeyAttrs, as exclusion indexes
won't exceed the ii_NumIndexKeyAttrs.

I've also moved the test cases to indexing.sql.  I'm unsure of its suitability, but seeing
pg_dump/pg_upgrade tests prompted the move.

--
Regards,
Japin Li



Attachments:

  [application/octet-stream] v2-restore-partitioned-tables-with-exclude-constraints.patch (4.4K, ../../ME0P300MB044553E723ED88E4B4C7FC82B691A@ME0P300MB0445.AUSP300.PROD.OUTLOOK.COM/3-v2-restore-partitioned-tables-with-exclude-constraints.patch)
  download | inline diff:
diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 739a92bdcc1..5fba4355d76 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -2645,9 +2645,21 @@ CompareIndexInfo(const IndexInfo *info1, const IndexInfo *info2,
 			return false;
 	}
 
-	/* No support currently for comparing exclusion indexes. */
-	if (info1->ii_ExclusionOps != NULL || info2->ii_ExclusionOps != NULL)
+	/* Exclusion index must be identical, if they exist */
+	if ((info1->ii_ExclusionOps == NULL) != (info2->ii_ExclusionOps == NULL))
 		return false;
+	if (info1->ii_ExclusionOps != NULL)
+	{
+		for (i = 0; i < info1->ii_NumIndexKeyAttrs; i++)
+		{
+			if (info1->ii_ExclusionOps[i] != info2->ii_ExclusionOps[i])
+				return false;
+			if (info1->ii_ExclusionProcs[i] != info2->ii_ExclusionProcs[i])
+				return false;
+			if (info1->ii_ExclusionStrats[i] != info2->ii_ExclusionStrats[i])
+				return false;
+		}
+	}
 
 	return true;
 }
diff --git a/src/test/regress/expected/indexing.out b/src/test/regress/expected/indexing.out
index bcf1db11d73..30c35b8784f 100644
--- a/src/test/regress/expected/indexing.out
+++ b/src/test/regress/expected/indexing.out
@@ -1669,3 +1669,24 @@ reindex index test_pg_index_toast_index;
 drop index test_pg_index_toast_index;
 drop function test_pg_index_toast_func;
 drop table test_pg_index_toast_table;
+-- test that attaching exclusion index on partition table
+create schema regress_excl_indexing;
+set search_path to regress_excl_indexing;
+create table idxpart (a int4range, b int4range) partition by list (a);
+create table idxpart_1 (a int4range, b int4range);
+alter table only idxpart attach partition idxpart_1 for values in ('[0,1)'::int4range);
+alter table only idxpart add constraint idxpart_id_data_excl exclude USING GIST (a with =, b with &&);
+alter table only idxpart_1 add constraint idxpart_1_id_data_excl exclude USING GIST (a with &&, b with &&);
+alter index idxpart_id_data_excl attach partition idxpart_1_id_data_excl;
+ERROR:  cannot attach index "idxpart_1_id_data_excl" as a partition of index "idxpart_id_data_excl"
+DETAIL:  The index definitions do not match.
+drop table idxpart, idxpart_1;
+-- More objects intentionally left behind, to verify some pg_dump/pg_upgrade
+-- behavior.
+create table exclpart (a int4range, b int4range) partition by list (a);
+create table exclpart_1 (a int4range, b int4range);
+alter table only exclpart attach partition exclpart_1 for values in ('[0,1)'::int4range);
+alter table only exclpart add constraint exclpart_id_data_excl exclude USING GIST (a with =, b with &&);
+alter table only exclpart_1 add constraint exclpart_1_id_data_excl exclude USING GIST (a with =, b with &&);
+alter index exclpart_id_data_excl attach partition exclpart_1_id_data_excl;
+reset search_path;
diff --git a/src/test/regress/sql/indexing.sql b/src/test/regress/sql/indexing.sql
index b5cb01c2d70..aae277aab03 100644
--- a/src/test/regress/sql/indexing.sql
+++ b/src/test/regress/sql/indexing.sql
@@ -934,3 +934,23 @@ reindex index test_pg_index_toast_index;
 drop index test_pg_index_toast_index;
 drop function test_pg_index_toast_func;
 drop table test_pg_index_toast_table;
+
+-- test that attaching exclusion index on partition table
+create schema regress_excl_indexing;
+set search_path to regress_excl_indexing;
+create table idxpart (a int4range, b int4range) partition by list (a);
+create table idxpart_1 (a int4range, b int4range);
+alter table only idxpart attach partition idxpart_1 for values in ('[0,1)'::int4range);
+alter table only idxpart add constraint idxpart_id_data_excl exclude USING GIST (a with =, b with &&);
+alter table only idxpart_1 add constraint idxpart_1_id_data_excl exclude USING GIST (a with &&, b with &&);
+alter index idxpart_id_data_excl attach partition idxpart_1_id_data_excl;
+drop table idxpart, idxpart_1;
+-- More objects intentionally left behind, to verify some pg_dump/pg_upgrade
+-- behavior.
+create table exclpart (a int4range, b int4range) partition by list (a);
+create table exclpart_1 (a int4range, b int4range);
+alter table only exclpart attach partition exclpart_1 for values in ('[0,1)'::int4range);
+alter table only exclpart add constraint exclpart_id_data_excl exclude USING GIST (a with =, b with &&);
+alter table only exclpart_1 add constraint exclpart_1_id_data_excl exclude USING GIST (a with =, b with &&);
+alter index exclpart_id_data_excl attach partition exclpart_1_id_data_excl;
+reset search_path;


^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: 回复: pg_restore error with partitioned table having exclude constraint
  2025-04-17 05:11 pg_restore error with partitioned table having exclude constraint Keith Paskett <keith.paskett@logansw.com>
  2025-04-17 13:06 ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-17 14:54   ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-17 15:18     ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-24 15:07       ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-28 08:42         ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-29 14:44           ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-29 14:53             ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-30 06:38               ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-30 10:45                 ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-05-14 11:10                   `  回复: pg_restore error with partitioned table having exclude constraint Li Japin <japinli@hotmail.com>
@ 2026-07-20 15:34                     ` Álvaro Herrera <alvherre@kurilemu.de>
  2026-07-21 10:23                       ` Re: 回复: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  0 siblings, 1 reply; 15+ messages in thread

From: Álvaro Herrera @ 2026-07-20 15:34 UTC (permalink / raw)
  To: Li Japin <japinli@hotmail.com>; +Cc: Keith Paskett <keith.paskett@logansw.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

On 2025-May-14, Li Japin wrote:

> Apologies for the delay.  Considering it further, ignoring ii_ExclusionProcs and
> ii_ExclusionStrats seems incorrect given custom operators.
> 
> I've also updated ii_NumIndexAttrs to ii_NumIndexKeyAttrs, as exclusion indexes
> won't exceed the ii_NumIndexKeyAttrs.
> 
> I've also moved the test cases to indexing.sql.  I'm unsure of its suitability, but seeing
> pg_dump/pg_upgrade tests prompted the move.

Thanks for updating it.  I agree that adding the tests to indexing.sql
is the right move.  I have polished the patch a bit more and pushed to
branches from 17 onwards.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/






^ permalink  raw  reply  [nested|flat] 15+ messages in thread

* Re: 回复: pg_restore error with partitioned table having exclude constraint
  2025-04-17 05:11 pg_restore error with partitioned table having exclude constraint Keith Paskett <keith.paskett@logansw.com>
  2025-04-17 13:06 ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-17 14:54   ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-17 15:18     ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-24 15:07       ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-28 08:42         ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-29 14:44           ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-29 14:53             ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-04-30 06:38               ` Re: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>
  2025-04-30 10:45                 ` Re: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
  2025-05-14 11:10                   `  回复: pg_restore error with partitioned table having exclude constraint Li Japin <japinli@hotmail.com>
  2026-07-20 15:34                     ` Re: 回复: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
@ 2026-07-21 10:23                       ` Japin Li <japinli@hotmail.com>
  0 siblings, 0 replies; 15+ messages in thread

From: Japin Li @ 2026-07-21 10:23 UTC (permalink / raw)
  To: Álvaro Herrera <alvherre@kurilemu.de>; +Cc: Keith Paskett <keith.paskett@logansw.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

On Mon, 20 Jul 2026 at 17:34, Álvaro Herrera <alvherre@kurilemu.de> wrote:
> On 2025-May-14, Li Japin wrote:
>
>> Apologies for the delay.  Considering it further, ignoring ii_ExclusionProcs and
>> ii_ExclusionStrats seems incorrect given custom operators.
>> 
>> I've also updated ii_NumIndexAttrs to ii_NumIndexKeyAttrs, as exclusion indexes
>> won't exceed the ii_NumIndexKeyAttrs.
>> 
>> I've also moved the test cases to indexing.sql.  I'm unsure of its suitability, but seeing
>> pg_dump/pg_upgrade tests prompted the move.
>
> Thanks for updating it.  I agree that adding the tests to indexing.sql
> is the right move.  I have polished the patch a bit more and pushed to
> branches from 17 onwards.
>

Thanks for pushing the patch.

> -- 
> Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/

-- 
Regards,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.






^ permalink  raw  reply  [nested|flat] 15+ messages in thread


end of thread, other threads:[~2026-07-21 10:23 UTC | newest]

Thread overview: 15+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-04-17 05:11 pg_restore error with partitioned table having exclude constraint Keith Paskett <keith.paskett@logansw.com>
2025-04-17 11:06 ` Japin Li <japinli@hotmail.com>
2025-04-17 13:06 ` Álvaro Herrera <alvherre@kurilemu.de>
2025-04-17 14:54   ` Japin Li <japinli@hotmail.com>
2025-04-17 15:18     ` Álvaro Herrera <alvherre@kurilemu.de>
2025-04-17 19:03       ` Keith Paskett <keith.paskett@logansw.com>
2025-04-24 15:07       ` Japin Li <japinli@hotmail.com>
2025-04-28 08:42         ` Álvaro Herrera <alvherre@kurilemu.de>
2025-04-29 14:44           ` Japin Li <japinli@hotmail.com>
2025-04-29 14:53             ` Álvaro Herrera <alvherre@kurilemu.de>
2025-04-30 06:38               ` Japin Li <japinli@hotmail.com>
2025-04-30 10:45                 ` Álvaro Herrera <alvherre@kurilemu.de>
2025-05-14 11:10                   `  回复: pg_restore error with partitioned table having exclude constraint Li Japin <japinli@hotmail.com>
2026-07-20 15:34                     ` Re: 回复: pg_restore error with partitioned table having exclude constraint Álvaro Herrera <alvherre@kurilemu.de>
2026-07-21 10:23                       ` Re: 回复: pg_restore error with partitioned table having exclude constraint Japin Li <japinli@hotmail.com>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox