pgsql: Add more test coverage for pg_clear_attribute_stats()

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add more test coverage for pg_clear_attribute_stats()
Date: 2026-09-02 07:23:10
Message-ID: E1x1fJN-000000039Cs-1Xk2@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add more test coverage for pg_clear_attribute_stats()

pg_clear_attribute_stats() was called exactly once in the whole test
suite, only for a correct cleanup. None of its failure scenarios were
covered, in terms of:
- NULL input values
- Incorrect object names (schema, attribute, relation)
- Incorrect relkinds
- Inherited pg_statistic entry cleanup

All these cases are now covered. This would have caught the failure
fixed by 11ed011ae22, as one example.

Author: Zhong ShiHao <zhong950419(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAGRkXqQEFzVh_bQSoLGDqaRTq7Xta6OUoda8PDrWDPWcAuwk=w@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/66f85615d5d650c47b6e8ea75e32a6817cb23dac

Modified Files
--------------
src/test/regress/expected/stats_import.out | 137 +++++++++++++++++++++++++++++
src/test/regress/sql/stats_import.sql | 96 ++++++++++++++++++++
2 files changed, 233 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2026-09-02 07:28:28 pgsql: pgindent fix for a63df2664225d06d5be
Previous Message Richard Guo 2026-09-02 06:35:03 pgsql: Fix qual pushdown past grouping through simple CASE