|
529 | 529 | $$ |
530 | 530 | LANGUAGE plpgsql; |
531 | 531 |
|
532 | | -/* |
533 | | - * Merge multiple partitions. All data will be copied to the first one. |
534 | | - * The rest of partitions will be dropped. |
535 | | -*/ |
536 | | -CREATEOR REPLACE FUNCTION @extschema@.merge_range_partitions( |
537 | | -partitionsREGCLASS[]) |
538 | | -RETURNS VOIDAS'pg_pathman','merge_range_partitions' |
539 | | -LANGUAGE C STRICT; |
540 | | - |
541 | 532 | /* |
542 | 533 | * The special case of merging two partitions |
543 | 534 | */ |
|
656 | 647 | $$ |
657 | 648 | LANGUAGE plpgsql; |
658 | 649 |
|
659 | | - |
660 | 650 | /* |
661 | 651 | * Prepend new partition. |
662 | 652 | */ |
|
762 | 752 | $$ |
763 | 753 | LANGUAGE plpgsql; |
764 | 754 |
|
765 | | - |
766 | 755 | /* |
767 | 756 | * Add new partition |
768 | 757 | */ |
|
807 | 796 | $$ |
808 | 797 | LANGUAGE plpgsql; |
809 | 798 |
|
810 | | - |
811 | 799 | /* |
812 | 800 | * Drop range partition |
813 | 801 | */ |
|
874 | 862 | LANGUAGE plpgsql |
875 | 863 | SETpg_pathman.enable_partitionfilter= off;/* ensures that PartitionFilter is OFF*/ |
876 | 864 |
|
877 | | - |
878 | | -/* |
879 | | - * Drops partition and expands the next partition so that it cover dropped |
880 | | - * one |
881 | | - * |
882 | | - * This function was written in order to support Oracle-like ALTER TABLE ... |
883 | | - * DROP PARTITION. In Oracle partitions only have upper bound and when |
884 | | - * partition is dropped the next one automatically covers freed range |
885 | | -*/ |
886 | | -CREATEOR REPLACE FUNCTION @extschema@.drop_range_partition_expand_next(relid REGCLASS) |
887 | | -RETURNS VOIDAS'pg_pathman','drop_range_partition_expand_next' |
888 | | -LANGUAGE C STRICT; |
889 | | - |
890 | | - |
891 | 865 | /* |
892 | 866 | * Attach range partition |
893 | 867 | */ |
|
966 | 940 | $$ |
967 | 941 | LANGUAGE plpgsql; |
968 | 942 |
|
969 | | - |
970 | 943 | /* |
971 | 944 | * Detach range partition |
972 | 945 | */ |
|
1010 | 983 | $$ |
1011 | 984 | LANGUAGE plpgsql; |
1012 | 985 |
|
1013 | | - |
1014 | 986 | /* |
1015 | 987 | * Creates an update trigger |
1016 | 988 | */ |
@@ -1107,6 +1079,29 @@ BEGIN |
1107 | 1079 | END |
1108 | 1080 | $$ LANGUAGE plpgsql; |
1109 | 1081 |
|
| 1082 | + |
| 1083 | +/* |
| 1084 | + * Merge multiple partitions. All data will be copied to the first one. |
| 1085 | + * The rest of partitions will be dropped. |
| 1086 | +*/ |
| 1087 | +CREATEOR REPLACE FUNCTION @extschema@.merge_range_partitions( |
| 1088 | +partitionsREGCLASS[]) |
| 1089 | +RETURNS VOIDAS'pg_pathman','merge_range_partitions' |
| 1090 | +LANGUAGE C STRICT; |
| 1091 | + |
| 1092 | +/* |
| 1093 | + * Drops partition and expands the next partition so that it cover dropped |
| 1094 | + * one |
| 1095 | + * |
| 1096 | + * This function was written in order to support Oracle-like ALTER TABLE ... |
| 1097 | + * DROP PARTITION. In Oracle partitions only have upper bound and when |
| 1098 | + * partition is dropped the next one automatically covers freed range |
| 1099 | +*/ |
| 1100 | +CREATEOR REPLACE FUNCTION @extschema@.drop_range_partition_expand_next( |
| 1101 | +partitionREGCLASS) |
| 1102 | +RETURNS VOIDAS'pg_pathman','drop_range_partition_expand_next' |
| 1103 | +LANGUAGE C STRICT; |
| 1104 | + |
1110 | 1105 | /* |
1111 | 1106 | * Creates new RANGE partition. Returns partition name. |
1112 | 1107 | * NOTE: This function SHOULD NOT take xact_handling lock (BGWs in 9.5). |
|