diff options
author | Andres Freund <andres@anarazel.de> | 2022-09-23 13:00:55 -0700 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2022-09-23 13:13:50 -0700 |
commit | 43e496e242984320efcf42c51c1e2b379aa03344 (patch) | |
tree | 9ddabb45ce9cc9fa7525e102f0c14c62bd5f8134 /src/backend/utils/adt/numeric.c | |
parent | e956325c8bc8c7257b04c322bf996fff2d81b514 (diff) | |
download | postgresql-43e496e242984320efcf42c51c1e2b379aa03344.tar.gz postgresql-43e496e242984320efcf42c51c1e2b379aa03344.zip |
pgstat: Fix transactional stats dropping for indexes
Because index creation does not go through heap_create_with_catalog() we
didn't call pgstat_create_relation(), leading to index stats of a newly
created realtion not getting dropped during rollback. To fix, move the
pgstat_create_relation() to heap_create(), which indexes do use.
Similarly, because dropping an index does not go through
heap_drop_with_catalog(), we didn't drop index stats when the transaction
dropping an index committed. Here there's no convenient common path for
indexes and relations, so index_drop() now calls pgstat_drop_relation().
Add tests for transactional index stats handling.
Author: "Drouvot, Bertrand" <bdrouvot@amazon.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Discussion: https://postgr.es/m/51bbf286-2b4a-8998-bd12-eaae4b765d99@amazon.com
Backpatch: 15-, like 8b1dccd37c71, which introduced the bug
Diffstat (limited to 'src/backend/utils/adt/numeric.c')
0 files changed, 0 insertions, 0 deletions