Improve pg_clear_extended_stats() with incorrect relation/stats combination
Michael Paquier <michael@paquier.xyz>
Improve pg_clear_extended_stats() with incorrect relation/stats combination Issue fat-fingered in d756fa1019ff, noticed while doing more review of the main patch set proposed. I have missed the fact that this can be triggered by specifying an extended stats object that does not match with the relation specified and already locked. Like the cases where an object defined in input is missing, the code is changed to issue a WARNING instead of a confusing cache lookup failure. A regression test is added to cover this case. Discussion: https://postgr.es/m/CADkLM=dpz3KFnqP-dgJ-zvRvtjsa8UZv8wDAQdqho=qN3kX0Zg@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/statistics/extended_stats_funcs.c | modified | +9 −2 |
| src/test/regress/expected/stats_import.out | modified | +12 −0 |
| src/test/regress/sql/stats_import.sql | modified | +6 −0 |
Discussion
- Extended Statistics set/restore/clear functions. 140 messages · 2025-01-22 → 2026-01-29