@@ -670,3 +670,78 @@ 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 (uninitialized pg_pathman)
676
+ * ------------------------------------------
677
+ */
678
+ CREATE SCHEMA calamity;
679
+ CREATE EXTENSION pg_pathman;
680
+ /* check function pathman_cache_search_relid() */
681
+ CREATE TABLE calamity.survivor(val INT NOT NULL);
682
+ SELECT create_range_partitions('calamity.survivor', 'val', 1, 10, 2);
683
+ NOTICE: sequence "survivor_seq" does not exist, skipping
684
+ create_range_partitions
685
+ -------------------------
686
+ 2
687
+ (1 row)
688
+
689
+ DROP EXTENSION pg_pathman CASCADE;
690
+ SET pg_pathman.enable = f; /* DON'T LOAD CONFIG */
691
+ NOTICE: RuntimeAppend, RuntimeMergeAppend and PartitionFilter nodes and some other options have been disabled
692
+ CREATE EXTENSION pg_pathman;
693
+ SHOW pg_pathman.enable;
694
+ pg_pathman.enable
695
+ -------------------
696
+ off
697
+ (1 row)
698
+
699
+ SELECT add_to_pathman_config('calamity.survivor', 'val', '10'); /* not ok */
700
+ ERROR: pg_pathman is not initialized yet
701
+ SELECT * FROM pathman_partition_list; /* not ok */
702
+ ERROR: pg_pathman is not initialized yet
703
+ SELECT get_part_range('calamity.survivor', 0, NULL::INT); /* not ok */
704
+ ERROR: pg_pathman is not initialized yet
705
+ EXPLAIN (COSTS OFF) SELECT * FROM calamity.survivor; /* OK */
706
+ QUERY PLAN
707
+ ------------------------------
708
+ Append
709
+ -> Seq Scan on survivor
710
+ -> Seq Scan on survivor_1
711
+ -> Seq Scan on survivor_2
712
+ (4 rows)
713
+
714
+ SET pg_pathman.enable = t; /* LOAD CONFIG */
715
+ NOTICE: RuntimeAppend, RuntimeMergeAppend and PartitionFilter nodes and some other options have been enabled
716
+ SELECT add_to_pathman_config('calamity.survivor', 'val', '10'); /* OK */
717
+ add_to_pathman_config
718
+ -----------------------
719
+ t
720
+ (1 row)
721
+
722
+ SELECT * FROM pathman_partition_list; /* OK */
723
+ parent | partition | parttype | partattr | range_min | range_max
724
+ -------------------+---------------------+----------+----------+-----------+-----------
725
+ calamity.survivor | calamity.survivor_1 | 2 | val | 1 | 11
726
+ calamity.survivor | calamity.survivor_2 | 2 | val | 11 | 21
727
+ (2 rows)
728
+
729
+ SELECT get_part_range('calamity.survivor', 0, NULL::INT); /* OK */
730
+ get_part_range
731
+ ----------------
732
+ {1,11}
733
+ (1 row)
734
+
735
+ EXPLAIN (COSTS OFF) SELECT * FROM calamity.survivor; /* OK */
736
+ QUERY PLAN
737
+ ------------------------------
738
+ Append
739
+ -> Seq Scan on survivor_1
740
+ -> Seq Scan on survivor_2
741
+ (3 rows)
742
+
743
+ DROP TABLE calamity.survivor CASCADE;
744
+ NOTICE: drop cascades to 2 other objects
745
+ DROP SCHEMA calamity CASCADE;
746
+ NOTICE: drop cascades to sequence calamity.survivor_seq
747
+ DROP EXTENSION pg_pathman;
0 commit comments