postgresql/src/test/regress
Andres Freund d811ce6ea3 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 8b1dccd37c, which introduced the bug
2022-09-23 13:00:55 -07:00
..
data Fix full text search to handle NOT above a phrase search correctly. 2020-04-27 12:21:04 -04:00
expected pgstat: Fix transactional stats dropping for indexes 2022-09-23 13:00:55 -07:00
sql pgstat: Fix transactional stats dropping for indexes 2022-09-23 13:00:55 -07:00
.gitignore Fix inconsistencies and typos in the tree, take 10 2019-08-13 13:53:41 +09:00
GNUmakefile Refactor DLSUFFIX handling 2022-03-25 08:56:02 +01:00
Makefile Fix non-GNU makefiles for AIX make. 2017-11-30 00:57:22 -08:00
meson.build meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
parallel_schedule Revert SQL/JSON features 2022-09-01 17:07:14 -04:00
pg_regress_main.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_regress.c Use SIGNAL_ARGS consistently to declare signal handlers. 2022-09-14 14:44:50 -04:00
pg_regress.h regress: allow to specify directory containing expected files, for ecpg 2022-08-20 10:59:01 -07:00
README Don't generate plain-text HISTORY and src/test/regress/README anymore. 2014-02-10 20:48:04 -05:00
regress.c Split up guc.c for better build speed and ease of maintenance. 2022-09-13 11:11:45 -04:00
regressplans.sh Fix inconsistencies in the code 2019-07-08 13:15:09 +09:00
resultmap Remove HP-UX port. 2022-07-08 14:05:05 +12:00

Documentation concerning how to run these regression tests and interpret
the results can be found in the PostgreSQL manual, in the chapter
"Regression Tests".