@@ -77,9 +77,6 @@ SELECT pg_catalog.pg_extension_config_dump('@extschema@.pathman_config', '');
77
77
SELECT pg_catalog .pg_extension_config_dump (' @extschema@.pathman_config_params' ,' ' );
78
78
79
79
80
- CREATEOR REPLACE FUNCTION @extschema@.invalidate_relcache(relidOID )
81
- RETURNS VOIDAS ' pg_pathman' LANGUAGE C STRICT;
82
-
83
80
CREATEOR REPLACE FUNCTION @extschema@.partitions_count(relation REGCLASS)
84
81
RETURNSINT AS
85
82
$$
150
147
$$
151
148
LANGUAGE plpgsql;
152
149
150
+ /*
151
+ * Show all existing parents and partitions.
152
+ */
153
+ CREATEOR REPLACE FUNCTION @extschema@.show_partition_list()
154
+ RETURNS TABLE (
155
+ parentREGCLASS,
156
+ partitionREGCLASS,
157
+ parttypeINT4,
158
+ partattrTEXT ,
159
+ range_minTEXT ,
160
+ range_maxTEXT )
161
+ AS ' pg_pathman' ,' show_partition_list_internal' LANGUAGE C STRICT;
162
+
163
+ /*
164
+ * View for show_partition_list().
165
+ */
166
+ CREATEOR REPLACE VIEW @extschema@.pathman_partition_list
167
+ AS SELECT * FROM @extschema@.show_partition_list();
168
+
153
169
/*
154
170
* Show all existing concurrent partitioning tasks.
155
171
*/
@@ -160,8 +176,8 @@ RETURNS TABLE (
160
176
dbidOID ,
161
177
relidREGCLASS,
162
178
processedINT ,
163
- statusTEXT
164
- ) AS ' pg_pathman' ,' show_concurrent_part_tasks_internal' LANGUAGE C STRICT;
179
+ statusTEXT )
180
+ AS ' pg_pathman' ,' show_concurrent_part_tasks_internal' LANGUAGE C STRICT;
165
181
166
182
/*
167
183
* View for show_concurrent_part_tasks().
348
364
LANGUAGE plpgsql;
349
365
350
366
/*
351
- * Returns relname without quotes or something
367
+ * Returns relname without quotes or something.
352
368
*/
353
369
CREATEOR REPLACE FUNCTION @extschema@.get_plain_schema_and_relname(
354
370
clsREGCLASS,
366
382
LANGUAGE plpgsql STRICT;
367
383
368
384
/*
369
- * Returns schema-qualified namefor table
385
+ * Returnsthe schema-qualified nameof table.
370
386
*/
371
387
CREATEOR REPLACE FUNCTION @extschema@.get_schema_qualified_name(
372
388
clsREGCLASS,
385
401
LANGUAGE plpgsql STRICT;
386
402
387
403
/*
388
- * Validates relation name. It must be schema qualified
404
+ * Validates relation name. It must be schema qualified.
389
405
*/
390
406
CREATEOR REPLACE FUNCTION @extschema@.validate_relname(
391
407
clsREGCLASS)
407
423
LANGUAGE plpgsql;
408
424
409
425
/*
410
- * Check if two relations have equal structures
426
+ * Check if two relations have equal structures.
411
427
*/
412
428
CREATEOR REPLACE FUNCTION @extschema@.validate_relations_equality(
413
429
relation1OID , relation2OID )
439
455
LANGUAGE plpgsql;
440
456
441
457
/*
442
- * DDL trigger that deletes entry from pathman_config table
458
+ * DDL trigger that deletes entry from pathman_config table.
443
459
*/
444
460
CREATEOR REPLACE FUNCTION @extschema@.pathman_ddl_trigger_func()
445
461
RETURNS event_triggerAS
472
488
LANGUAGE plpgsql;
473
489
474
490
/*
475
- * Droptrigger
491
+ * Droptriggers.
476
492
*/
477
493
CREATEOR REPLACE FUNCTION @extschema@.drop_triggers(
478
494
parent_relidREGCLASS)
485
501
$$ LANGUAGE plpgsql STRICT;
486
502
487
503
/*
488
- * Drop partitions
489
- *If delete_data set to TRUE then partitions will be dropped with all the data
504
+ * Drop partitions. If delete_data set to TRUE, partitions
505
+ * will be dropped with all the data.
490
506
*/
491
507
CREATEOR REPLACE FUNCTION @extschema@.drop_partitions(
492
508
parent_relidREGCLASS,
@@ -578,16 +594,6 @@ ON sql_drop
578
594
EXECUTE PROCEDURE @extschema@.pathman_ddl_trigger_func();
579
595
580
596
581
- /*
582
- * Attach a previously partitioned table
583
- */
584
- CREATEOR REPLACE FUNCTION @extschema@.add_to_pathman_config(
585
- parent_relidREGCLASS,
586
- attnameTEXT ,
587
- range_intervalTEXT DEFAULTNULL )
588
- RETURNSBOOLEAN AS ' pg_pathman' ,' add_to_pathman_config'
589
- LANGUAGE C;
590
-
591
597
592
598
CREATEOR REPLACE FUNCTION @extschema@.on_create_partitions(
593
599
relidREGCLASS)
@@ -619,40 +625,41 @@ CREATE OR REPLACE FUNCTION @extschema@.get_base_type(REGTYPE)
619
625
RETURNS REGTYPEAS ' pg_pathman' ,' get_base_type_pl'
620
626
LANGUAGE C STRICT;
621
627
622
-
623
628
/*
624
- *Checks if attributeis nullable
629
+ *Returns attributetype name for relation.
625
630
*/
626
- CREATEOR REPLACE FUNCTION @extschema@.is_attribute_nullable (
631
+ CREATEOR REPLACE FUNCTION @extschema@.get_attribute_type (
627
632
REGCLASS,TEXT )
628
- RETURNSBOOLEAN AS ' pg_pathman' ,' is_attribute_nullable '
633
+ RETURNSREGTYPE AS ' pg_pathman' ,' get_attribute_type_pl '
629
634
LANGUAGE C STRICT;
630
635
631
636
/*
632
- *Check if regclass is date or timestamp
637
+ *Return tablespace name for specified relation.
633
638
*/
634
- CREATEOR REPLACE FUNCTION @extschema@.is_date_type(
635
- typidREGTYPE)
636
- RETURNSBOOLEAN AS ' pg_pathman' ,' is_date_type'
639
+ CREATEOR REPLACE FUNCTION @extschema@.get_rel_tablespace_name(relation REGCLASS)
640
+ RETURNSTEXT AS ' pg_pathman' ,' get_rel_tablespace_name'
637
641
LANGUAGE C STRICT;
638
642
643
+
639
644
/*
640
- *Returns attributetype name for relation
645
+ *Checks if attributeis nullable
641
646
*/
642
- CREATEOR REPLACE FUNCTION @extschema@.get_attribute_type (
647
+ CREATEOR REPLACE FUNCTION @extschema@.is_attribute_nullable (
643
648
REGCLASS,TEXT )
644
- RETURNSREGTYPE AS ' pg_pathman' ,' get_attribute_type_pl '
649
+ RETURNSBOOLEAN AS ' pg_pathman' ,' is_attribute_nullable '
645
650
LANGUAGE C STRICT;
646
651
647
652
/*
648
- *Get parent of pg_pathman's partition .
653
+ *Check if regclass is date or timestamp .
649
654
*/
650
- CREATEOR REPLACE FUNCTION @extschema@.get_parent_of_partition(REGCLASS)
651
- RETURNS REGCLASSAS ' pg_pathman' ,' get_parent_of_partition_pl'
655
+ CREATEOR REPLACE FUNCTION @extschema@.is_date_type(
656
+ typidREGTYPE)
657
+ RETURNSBOOLEAN AS ' pg_pathman' ,' is_date_type'
652
658
LANGUAGE C STRICT;
653
659
660
+
654
661
/*
655
- * Build check constraint name for a specified relation's column
662
+ * Build check constraint name for a specified relation's column.
656
663
*/
657
664
CREATEOR REPLACE FUNCTION @extschema@.build_check_constraint_name(
658
665
REGCLASS, INT2)
@@ -679,7 +686,22 @@ LANGUAGE C STRICT;
679
686
680
687
681
688
/*
682
- * Lock partitioned relation to restrict concurrent modification of partitioning scheme.
689
+ * Attach a previously partitioned table.
690
+ */
691
+ CREATEOR REPLACE FUNCTION @extschema@.add_to_pathman_config(
692
+ parent_relidREGCLASS,
693
+ attnameTEXT ,
694
+ range_intervalTEXT DEFAULTNULL )
695
+ RETURNSBOOLEAN AS ' pg_pathman' ,' add_to_pathman_config'
696
+ LANGUAGE C;
697
+
698
+ CREATEOR REPLACE FUNCTION @extschema@.invalidate_relcache(relidOID )
699
+ RETURNS VOIDAS ' pg_pathman' LANGUAGE C STRICT;
700
+
701
+
702
+ /*
703
+ * Lock partitioned relation to restrict concurrent
704
+ * modification of partitioning scheme.
683
705
*/
684
706
CREATEOR REPLACE FUNCTION @extschema@.lock_partitioned_relation(
685
707
REGCLASS)
@@ -702,18 +724,12 @@ CREATE OR REPLACE FUNCTION @extschema@.debug_capture()
702
724
RETURNS VOIDAS ' pg_pathman' ,' debug_capture'
703
725
LANGUAGE C STRICT;
704
726
705
- /*
706
- * Return tablespace name for specified relation.
707
- */
708
- CREATEOR REPLACE FUNCTION @extschema@.get_rel_tablespace_name(relation REGCLASS)
709
- RETURNSTEXT AS ' pg_pathman' ,' get_rel_tablespace_name'
710
- LANGUAGE C STRICT;
711
-
712
727
/*
713
728
* Checks that callback function meets specific requirements. Particularly it
714
729
* must have the only JSONB argument and VOID return type.
715
730
*/
716
- CREATEOR REPLACE FUNCTION @extschema@.validate_on_partition_created_callback(callback REGPROC)
731
+ CREATEOR REPLACE FUNCTION @extschema@.validate_on_partition_created_callback(
732
+ callbackREGPROC)
717
733
RETURNS VOIDAS ' pg_pathman' ,' validate_on_part_init_callback_pl'
718
734
LANGUAGE C STRICT;
719
735