@@ -77,9 +77,6 @@ SELECT pg_catalog.pg_extension_config_dump('@extschema@.pathman_config', '');
7777SELECT pg_catalog .pg_extension_config_dump (' @extschema@.pathman_config_params' ,' ' );
7878
7979
80- CREATEOR REPLACE FUNCTION @extschema@.invalidate_relcache(relidOID )
81- RETURNS VOIDAS ' pg_pathman' LANGUAGE C STRICT;
82-
8380CREATEOR REPLACE FUNCTION @extschema@.partitions_count(relation REGCLASS)
8481RETURNSINT AS
8582$$
150147$$
151148LANGUAGE plpgsql;
152149
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+
153169/*
154170 * Show all existing concurrent partitioning tasks.
155171*/
@@ -160,8 +176,8 @@ RETURNS TABLE (
160176dbidOID ,
161177relidREGCLASS,
162178processedINT ,
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;
165181
166182/*
167183 * View for show_concurrent_part_tasks().
348364LANGUAGE plpgsql;
349365
350366/*
351- * Returns relname without quotes or something
367+ * Returns relname without quotes or something.
352368*/
353369CREATEOR REPLACE FUNCTION @extschema@.get_plain_schema_and_relname(
354370clsREGCLASS,
366382LANGUAGE plpgsql STRICT;
367383
368384/*
369- * Returns schema-qualified namefor table
385+ * Returnsthe schema-qualified nameof table.
370386*/
371387CREATEOR REPLACE FUNCTION @extschema@.get_schema_qualified_name(
372388clsREGCLASS,
385401LANGUAGE plpgsql STRICT;
386402
387403/*
388- * Validates relation name. It must be schema qualified
404+ * Validates relation name. It must be schema qualified.
389405*/
390406CREATEOR REPLACE FUNCTION @extschema@.validate_relname(
391407clsREGCLASS)
407423LANGUAGE plpgsql;
408424
409425/*
410- * Check if two relations have equal structures
426+ * Check if two relations have equal structures.
411427*/
412428CREATEOR REPLACE FUNCTION @extschema@.validate_relations_equality(
413429relation1OID , relation2OID )
439455LANGUAGE plpgsql;
440456
441457/*
442- * DDL trigger that deletes entry from pathman_config table
458+ * DDL trigger that deletes entry from pathman_config table.
443459*/
444460CREATEOR REPLACE FUNCTION @extschema@.pathman_ddl_trigger_func()
445461RETURNS event_triggerAS
472488LANGUAGE plpgsql;
473489
474490/*
475- * Droptrigger
491+ * Droptriggers.
476492*/
477493CREATEOR REPLACE FUNCTION @extschema@.drop_triggers(
478494parent_relidREGCLASS)
485501$$ LANGUAGE plpgsql STRICT;
486502
487503/*
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.
490506*/
491507CREATEOR REPLACE FUNCTION @extschema@.drop_partitions(
492508parent_relidREGCLASS,
@@ -578,16 +594,6 @@ ON sql_drop
578594EXECUTE PROCEDURE @extschema@.pathman_ddl_trigger_func();
579595
580596
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-
591597
592598CREATEOR REPLACE FUNCTION @extschema@.on_create_partitions(
593599relidREGCLASS)
@@ -619,40 +625,41 @@ CREATE OR REPLACE FUNCTION @extschema@.get_base_type(REGTYPE)
619625RETURNS REGTYPEAS ' pg_pathman' ,' get_base_type_pl'
620626LANGUAGE C STRICT;
621627
622-
623628/*
624- *Checks if attributeis nullable
629+ *Returns attributetype name for relation.
625630*/
626- CREATEOR REPLACE FUNCTION @extschema@.is_attribute_nullable (
631+ CREATEOR REPLACE FUNCTION @extschema@.get_attribute_type (
627632REGCLASS,TEXT )
628- RETURNSBOOLEAN AS ' pg_pathman' ,' is_attribute_nullable '
633+ RETURNSREGTYPE AS ' pg_pathman' ,' get_attribute_type_pl '
629634LANGUAGE C STRICT;
630635
631636/*
632- *Check if regclass is date or timestamp
637+ *Return tablespace name for specified relation.
633638*/
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'
637641LANGUAGE C STRICT;
638642
643+
639644/*
640- *Returns attributetype name for relation
645+ *Checks if attributeis nullable
641646*/
642- CREATEOR REPLACE FUNCTION @extschema@.get_attribute_type (
647+ CREATEOR REPLACE FUNCTION @extschema@.is_attribute_nullable (
643648REGCLASS,TEXT )
644- RETURNSREGTYPE AS ' pg_pathman' ,' get_attribute_type_pl '
649+ RETURNSBOOLEAN AS ' pg_pathman' ,' is_attribute_nullable '
645650LANGUAGE C STRICT;
646651
647652/*
648- *Get parent of pg_pathman's partition .
653+ *Check if regclass is date or timestamp .
649654*/
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'
652658LANGUAGE C STRICT;
653659
660+
654661/*
655- * Build check constraint name for a specified relation's column
662+ * Build check constraint name for a specified relation's column.
656663*/
657664CREATEOR REPLACE FUNCTION @extschema@.build_check_constraint_name(
658665REGCLASS, INT2)
@@ -679,7 +686,22 @@ LANGUAGE C STRICT;
679686
680687
681688/*
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.
683705*/
684706 CREATEOR REPLACE FUNCTION @extschema@.lock_partitioned_relation(
685707 REGCLASS)
@@ -702,18 +724,12 @@ CREATE OR REPLACE FUNCTION @extschema@.debug_capture()
702724RETURNS VOIDAS ' pg_pathman' ,' debug_capture'
703725LANGUAGE C STRICT;
704726
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-
712727/*
713728 * Checks that callback function meets specific requirements. Particularly it
714729 * must have the only JSONB argument and VOID return type.
715730*/
716- CREATEOR REPLACE FUNCTION @extschema@.validate_on_partition_created_callback(callback REGPROC)
731+ CREATEOR REPLACE FUNCTION @extschema@.validate_on_partition_created_callback(
732+ callbackREGPROC)
717733RETURNS VOIDAS ' pg_pathman' ,' validate_on_part_init_callback_pl'
718734LANGUAGE C STRICT;
719735