@@ -510,7 +510,7 @@ SELECT create_hash_partitions('calamity.part_ok', 'val', 4);
510510CREATE TABLE calamity.wrong_partition (LIKE calamity.part_test) INHERITS (calamity.part_test); /* wrong partition w\o constraints */
511511NOTICE: merging column "val" with inherited definition
512512SELECT add_to_pathman_config('calamity.part_test', 'val');
513- ERROR: constraint "pathman_wrong_partition_1_check"for partition "wrong_partition" does not exist
513+ ERROR: constraint "pathman_wrong_partition_1_check"of partition "wrong_partition" does not exist
514514EXPLAIN (COSTS OFF) SELECT * FROM calamity.part_ok; /* check that pathman is enabled */
515515 QUERY PLAN
516516-----------------------------
@@ -522,7 +522,7 @@ EXPLAIN (COSTS OFF) SELECT * FROM calamity.part_ok; /* check that pathman is ena
522522(5 rows)
523523
524524SELECT add_to_pathman_config('calamity.part_test', 'val', '10');
525- ERROR: constraint "pathman_wrong_partition_1_check"for partition "wrong_partition" does not exist
525+ ERROR: constraint "pathman_wrong_partition_1_check"of partition "wrong_partition" does not exist
526526EXPLAIN (COSTS OFF) SELECT * FROM calamity.part_ok; /* check that pathman is enabled */
527527 QUERY PLAN
528528-----------------------------
@@ -670,6 +670,109 @@ NOTICE: drop cascades to table calamity.test_range_oid_1
670670DROP SCHEMA calamity CASCADE;
671671NOTICE: drop cascades to 18 other objects
672672DROP EXTENSION pg_pathman;
673+ /*
674+ * -------------------------------------
675+ * Special tests (pathman_cache_stats)
676+ * -------------------------------------
677+ */
678+ CREATE SCHEMA calamity;
679+ CREATE EXTENSION pg_pathman;
680+ /* Change this setting for code coverage */
681+ SET pg_pathman.enable_bounds_cache = false;
682+ /* check view pathman_cache_stats */
683+ CREATE TABLE calamity.test_pathman_cache_stats(val NUMERIC NOT NULL);
684+ SELECT create_range_partitions('calamity.test_pathman_cache_stats', 'val', 1, 10, 10);
685+ NOTICE: sequence "test_pathman_cache_stats_seq" does not exist, skipping
686+ create_range_partitions
687+ -------------------------
688+ 10
689+ (1 row)
690+
691+ SELECT context, entries FROM pathman_cache_stats ORDER BY context;/* OK */
692+ context | entries
693+ --------------------------+---------
694+ maintenance | 0
695+ partition bounds cache | 0
696+ partition dispatch cache | 1
697+ partition parents cache | 10
698+ (4 rows)
699+
700+ SELECT drop_partitions('calamity.test_pathman_cache_stats');
701+ NOTICE: function calamity.test_pathman_cache_stats_upd_trig_func() does not exist, skipping
702+ NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_1
703+ NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_2
704+ NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_3
705+ NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_4
706+ NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_5
707+ NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_6
708+ NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_7
709+ NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_8
710+ NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_9
711+ NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_10
712+ drop_partitions
713+ -----------------
714+ 10
715+ (1 row)
716+
717+ SELECT context, entries FROM pathman_cache_stats ORDER BY context;/* OK */
718+ context | entries
719+ --------------------------+---------
720+ maintenance | 0
721+ partition bounds cache | 0
722+ partition dispatch cache | 0
723+ partition parents cache | 0
724+ (4 rows)
725+
726+ DROP TABLE calamity.test_pathman_cache_stats;
727+ /* Restore this GUC */
728+ SET pg_pathman.enable_bounds_cache = true;
729+ /* check view pathman_cache_stats (one more time) */
730+ CREATE TABLE calamity.test_pathman_cache_stats(val NUMERIC NOT NULL);
731+ SELECT create_range_partitions('calamity.test_pathman_cache_stats', 'val', 1, 10, 10);
732+ create_range_partitions
733+ -------------------------
734+ 10
735+ (1 row)
736+
737+ SELECT context, entries FROM pathman_cache_stats ORDER BY context;/* OK */
738+ context | entries
739+ --------------------------+---------
740+ maintenance | 0
741+ partition bounds cache | 10
742+ partition dispatch cache | 1
743+ partition parents cache | 10
744+ (4 rows)
745+
746+ SELECT drop_partitions('calamity.test_pathman_cache_stats');
747+ NOTICE: function calamity.test_pathman_cache_stats_upd_trig_func() does not exist, skipping
748+ NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_1
749+ NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_2
750+ NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_3
751+ NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_4
752+ NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_5
753+ NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_6
754+ NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_7
755+ NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_8
756+ NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_9
757+ NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_10
758+ drop_partitions
759+ -----------------
760+ 10
761+ (1 row)
762+
763+ SELECT context, entries FROM pathman_cache_stats ORDER BY context;/* OK */
764+ context | entries
765+ --------------------------+---------
766+ maintenance | 0
767+ partition bounds cache | 0
768+ partition dispatch cache | 0
769+ partition parents cache | 0
770+ (4 rows)
771+
772+ DROP TABLE calamity.test_pathman_cache_stats;
773+ DROP SCHEMA calamity CASCADE;
774+ NOTICE: drop cascades to sequence calamity.test_pathman_cache_stats_seq
775+ DROP EXTENSION pg_pathman;
673776/*
674777 * ------------------------------------------
675778 * Special tests (uninitialized pg_pathman)