We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 484ec05 commit 035889aCopy full SHA for 035889a
contrib/pg_pathman/sql/range.sql
@@ -703,3 +703,29 @@ BEGIN
703
, relation);
704
END
705
$$ LANGUAGE plpgsql;
706
+
707
708
+/*
709
+ *
710
+ */
711
+CREATE OR REPLACE FUNCTION create_new_partitions(
712
+ p_relid OID
713
+ , p_min ANYELEMENT
714
+ , p_max ANYELEMENT
715
+ , p_new_value ANYELEMENT)
716
+RETURNS INTEGER AS
717
+$$
718
+DECLARE
719
+ v_cnt INTEGER;
720
+ i INTEGER;
721
+BEGIN
722
+ v_cnt := (p_new_value - p_max) / (p_max - p_min) + 1;
723
+ FOR i IN 0..v_cnt-1
724
+ LOOP
725
+ PERFORM @extschema@.create_single_range_partition(p_relation
726
+ , p_max + (i * (p_max - p_min))
727
+ , p_max + ((i+1) * (p_max - p_min)));
728
+ END LOOP;
729
+ RETURN v_cnt;
730
+END
731
+$$ LANGUAGE plpgsql;
0 commit comments