@@ -677,6 +677,8 @@ DROP EXTENSION pg_pathman;
677
677
*/
678
678
CREATE SCHEMA calamity;
679
679
CREATE EXTENSION pg_pathman;
680
+ /* Change this setting for code coverage */
681
+ SET pg_pathman.enable_bounds_cache = false;
680
682
/* check view pathman_cache_stats */
681
683
CREATE TABLE calamity.test_pathman_cache_stats(val NUMERIC NOT NULL);
682
684
SELECT create_range_partitions('calamity.test_pathman_cache_stats', 'val', 1, 10, 10);
@@ -687,16 +689,89 @@ NOTICE: sequence "test_pathman_cache_stats_seq" does not exist, skipping
687
689
(1 row)
688
690
689
691
SELECT context, entries FROM pathman_cache_stats ORDER BY context;/* OK */
690
- context | entries
691
- -------------------------+---------
692
- maintenance | 0
693
- partition bounds cache |10
694
- partitionparents cache |10
695
- partitionpruning cache | 1
692
+ context | entries
693
+ -------------------------- +---------
694
+ maintenance | 0
695
+ partition bounds cache | 0
696
+ partitiondispatch cache | 1
697
+ partitionparents cache |10
696
698
(4 rows)
697
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;
698
773
DROP SCHEMA calamity CASCADE;
699
- NOTICE: drop cascades to12 other objects
774
+ NOTICE: drop cascades tosequence calamity.test_pathman_cache_stats_seq
700
775
DROP EXTENSION pg_pathman;
701
776
/*
702
777
* ------------------------------------------