@@ -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
- CREATE OR REPLACE FUNCTION @extschema@.invalidate_relcache(relid OID )
81
- RETURNS VOID AS ' pg_pathman' LANGUAGE C STRICT;
82
-
83
80
CREATE OR REPLACE FUNCTION @extschema@.partitions_count(relation REGCLASS)
84
81
RETURNS INT AS
85
82
$$
150
147
$$
151
148
LANGUAGE plpgsql;
152
149
150
+ /*
151
+ * Show all existing parents and partitions.
152
+ */
153
+ CREATE OR REPLACE FUNCTION @extschema@.show_partition_list()
154
+ RETURNS TABLE (
155
+ parent REGCLASS,
156
+ partition REGCLASS,
157
+ parttype INT4,
158
+ partattr TEXT ,
159
+ range_min TEXT ,
160
+ range_max TEXT )
161
+ AS ' pg_pathman' , ' show_partition_list_internal' LANGUAGE C STRICT;
162
+
163
+ /*
164
+ * View for show_partition_list().
165
+ */
166
+ CREATE OR 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
dbid OID ,
161
177
relid REGCLASS,
162
178
processed INT ,
163
- status TEXT
164
- ) AS ' pg_pathman' , ' show_concurrent_part_tasks_internal' LANGUAGE C STRICT;
179
+ status TEXT )
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
CREATE OR REPLACE FUNCTION @extschema@.get_plain_schema_and_relname(
354
370
cls REGCLASS,
366
382
LANGUAGE plpgsql STRICT;
367
383
368
384
/*
369
- * Returns schema-qualified name for table
385
+ * Returns the schema-qualified name of table.
370
386
*/
371
387
CREATE OR REPLACE FUNCTION @extschema@.get_schema_qualified_name(
372
388
cls REGCLASS,
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
CREATE OR REPLACE FUNCTION @extschema@.validate_relname(
391
407
cls REGCLASS)
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
CREATE OR REPLACE FUNCTION @extschema@.validate_relations_equality(
413
429
relation1 OID , relation2 OID )
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
CREATE OR REPLACE FUNCTION @extschema@.pathman_ddl_trigger_func()
445
461
RETURNS event_trigger AS
472
488
LANGUAGE plpgsql;
473
489
474
490
/*
475
- * Drop trigger
491
+ * Drop triggers.
476
492
*/
477
493
CREATE OR REPLACE FUNCTION @extschema@.drop_triggers(
478
494
parent_relid REGCLASS)
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
CREATE OR REPLACE FUNCTION @extschema@.drop_partitions(
492
508
parent_relid REGCLASS,
@@ -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
- CREATE OR REPLACE FUNCTION @extschema@.add_to_pathman_config(
585
- parent_relid REGCLASS,
586
- attname TEXT ,
587
- range_interval TEXT DEFAULT NULL )
588
- RETURNS BOOLEAN AS ' pg_pathman' , ' add_to_pathman_config'
589
- LANGUAGE C;
590
-
591
597
592
598
CREATE OR REPLACE FUNCTION @extschema@.on_create_partitions(
593
599
relid REGCLASS)
@@ -619,40 +625,41 @@ CREATE OR REPLACE FUNCTION @extschema@.get_base_type(REGTYPE)
619
625
RETURNS REGTYPE AS ' pg_pathman' , ' get_base_type_pl'
620
626
LANGUAGE C STRICT;
621
627
622
-
623
628
/*
624
- * Checks if attribute is nullable
629
+ * Returns attribute type name for relation.
625
630
*/
626
- CREATE OR REPLACE FUNCTION @extschema@.is_attribute_nullable (
631
+ CREATE OR REPLACE FUNCTION @extschema@.get_attribute_type (
627
632
REGCLASS, TEXT )
628
- RETURNS BOOLEAN AS ' pg_pathman' , ' is_attribute_nullable '
633
+ RETURNS REGTYPE 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
- CREATE OR REPLACE FUNCTION @extschema@.is_date_type(
635
- typid REGTYPE)
636
- RETURNS BOOLEAN AS ' pg_pathman' , ' is_date_type'
639
+ CREATE OR REPLACE FUNCTION @extschema@.get_rel_tablespace_name(relation REGCLASS)
640
+ RETURNS TEXT AS ' pg_pathman' , ' get_rel_tablespace_name'
637
641
LANGUAGE C STRICT;
638
642
643
+
639
644
/*
640
- * Returns attribute type name for relation
645
+ * Checks if attribute is nullable
641
646
*/
642
- CREATE OR REPLACE FUNCTION @extschema@.get_attribute_type (
647
+ CREATE OR REPLACE FUNCTION @extschema@.is_attribute_nullable (
643
648
REGCLASS, TEXT )
644
- RETURNS REGTYPE AS ' pg_pathman' , ' get_attribute_type_pl '
649
+ RETURNS BOOLEAN 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
- CREATE OR REPLACE FUNCTION @extschema@.get_parent_of_partition(REGCLASS)
651
- RETURNS REGCLASS AS ' pg_pathman' , ' get_parent_of_partition_pl'
655
+ CREATE OR REPLACE FUNCTION @extschema@.is_date_type(
656
+ typid REGTYPE)
657
+ RETURNS BOOLEAN 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
CREATE OR 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
+ CREATE OR REPLACE FUNCTION @extschema@.add_to_pathman_config(
692
+ parent_relid REGCLASS,
693
+ attname TEXT ,
694
+ range_interval TEXT DEFAULT NULL )
695
+ RETURNS BOOLEAN AS ' pg_pathman' , ' add_to_pathman_config'
696
+ LANGUAGE C;
697
+
698
+ CREATE OR REPLACE FUNCTION @extschema@.invalidate_relcache(relid OID )
699
+ RETURNS VOID AS ' pg_pathman' LANGUAGE C STRICT;
700
+
701
+
702
+ /*
703
+ * Lock partitioned relation to restrict concurrent
704
+ * modification of partitioning scheme.
683
705
*/
684
706
CREATE OR REPLACE FUNCTION @extschema@.lock_partitioned_relation(
685
707
REGCLASS)
@@ -702,18 +724,12 @@ CREATE OR REPLACE FUNCTION @extschema@.debug_capture()
702
724
RETURNS VOID AS ' pg_pathman' , ' debug_capture'
703
725
LANGUAGE C STRICT;
704
726
705
- /*
706
- * Return tablespace name for specified relation.
707
- */
708
- CREATE OR REPLACE FUNCTION @extschema@.get_rel_tablespace_name(relation REGCLASS)
709
- RETURNS TEXT 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
- CREATE OR REPLACE FUNCTION @extschema@.validate_on_partition_created_callback(callback REGPROC)
731
+ CREATE OR REPLACE FUNCTION @extschema@.validate_on_partition_created_callback(
732
+ callback REGPROC)
717
733
RETURNS VOID AS ' pg_pathman' , ' validate_on_part_init_callback_pl'
718
734
LANGUAGE C STRICT;
719
735
0 commit comments