Re: pg_dump: ALTER INDEX SET STATISTICS missing for index-backed constraints - Mailing list pgsql-hackers

From Andrew Krylosov
Subject Re: pg_dump: ALTER INDEX SET STATISTICS missing for index-backed constraints
Date
Msg-id CA+nn4-oaYHF5yZztH81WBzyKLM--DvpGs5G-Hm-Ey6y=VD7tjA@mail.gmail.com
Whole thread
In response to pg_dump: ALTER INDEX SET STATISTICS missing for index-backed constraints  (Zsolt Parragi <zsolt.parragi@percona.com>)
List pgsql-hackers
Hi,

> The last statement was missing from the pg_dump output.

The fix looks good to me. I applied your patch to d9b5a63f49 and
built with assertions enabled on macOS arm64. The pg_dump and
pg_upgrade suites passed. The new test fails without the C change
and passes with it.

I also checked restores from plain, custom, directory and tar dumps,
including parallel restore and restore as a non-superuser owner.
Statistics targets were preserved for multiple expressions, quoted
and renamed indexes, and values 0 and 10000. A same-version
pg_upgrade preserved them too.

The test could also use different targets for expression columns 1
and 3, with a plain column between them, as the existing
ordinary-index test does. That would also cover pairing the column
numbers with their targets. I tried this case separately and
it works with the patch.

I found the same omission in REL_14_STABLE through REL_19_STABLE by
code inspection; I haven't built or tested those branches. I think
this should be backpatched through 14.

This looks ready for a committer.

Best regards,
Andrew Krylosov



pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: Typo in version check in postgresAcquireSampleRowsFunc
Next
From: Matheus Alcantara
Date:
Subject: Re: [PATCH v1] Fix for Bug#19724 - ALTER TYPE ... ALTER ATTRIBUTE triggers internal error for base type of domain with check