@@ -510,7 +510,7 @@ SELECT create_hash_partitions('calamity.part_ok', 'val', 4);
510
510
CREATE TABLE calamity.wrong_partition (LIKE calamity.part_test) INHERITS (calamity.part_test); /* wrong partition w\o constraints */
511
511
NOTICE: merging column "val" with inherited definition
512
512
SELECT 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
514
514
EXPLAIN (COSTS OFF) SELECT * FROM calamity.part_ok; /* check that pathman is enabled */
515
515
QUERY PLAN
516
516
-----------------------------
@@ -522,7 +522,7 @@ EXPLAIN (COSTS OFF) SELECT * FROM calamity.part_ok; /* check that pathman is ena
522
522
(5 rows)
523
523
524
524
SELECT 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
526
526
EXPLAIN (COSTS OFF) SELECT * FROM calamity.part_ok; /* check that pathman is enabled */
527
527
QUERY PLAN
528
528
-----------------------------
@@ -670,6 +670,109 @@ NOTICE: drop cascades to table calamity.test_range_oid_1
670
670
DROP SCHEMA calamity CASCADE;
671
671
NOTICE: drop cascades to 18 other objects
672
672
DROP 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;
673
776
/*
674
777
* ------------------------------------------
675
778
* Special tests (uninitialized pg_pathman)