Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit035889a

Browse files
committed
pathman: create partitions on insert trigger (not finished)
1 parent484ec05 commit035889a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

‎contrib/pg_pathman/sql/range.sql

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,3 +703,29 @@ BEGIN
703703
, relation);
704704
END
705705
$$ LANGUAGE plpgsql;
706+
707+
708+
/*
709+
*
710+
*/
711+
CREATE OR REPLACEFUNCTIONcreate_new_partitions(
712+
p_relidOID
713+
, p_min ANYELEMENT
714+
, p_max ANYELEMENT
715+
, p_new_value ANYELEMENT)
716+
RETURNSINTEGERAS
717+
$$
718+
DECLARE
719+
v_cntINTEGER;
720+
iINTEGER;
721+
BEGIN
722+
v_cnt := (p_new_value- p_max)/ (p_max- p_min)+1;
723+
FOR iIN0..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

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp