Skip to content

Commit 69c1b6d

Browse files
committed
purge regression results + update .gitignore, small improvements in range.sql
1 parent 44d88c6 commit 69c1b6d

File tree

7 files changed

+17
-1995
lines changed

7 files changed

+17
-1995
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.deps
22
isolation_output
3-
results/pg_pathman.out
3+
results/*
44
regression.diffs
55
regression.out
66
*.o

range.sql

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ RETURNS INTEGER AS
8989
$$
9090
DECLARE
9191
v_rows_count INTEGER;
92+
v_atttype REGTYPE;
9293
v_max p_start_value%TYPE;
9394
v_cur_value p_start_value%TYPE := p_start_value;
9495
p_end_value p_start_value%TYPE;
@@ -128,6 +129,8 @@ BEGIN
128129
END LOOP;
129130
END IF;
130131

132+
v_atttype := @extschema@.get_base_type(pg_typeof(p_start_value));
133+
131134
/*
132135
* In case when user doesn't want to automatically create partitions
133136
* and specifies partition count as 0 then do not check boundaries
@@ -146,7 +149,7 @@ BEGIN
146149
p_attribute,
147150
p_start_value,
148151
p_end_value,
149-
@extschema@.get_base_type(pg_typeof(p_start_value))::TEXT);
152+
v_atttype::TEXT);
150153
END IF;
151154

152155
/* Create sequence for child partitions names */
@@ -162,7 +165,7 @@ BEGIN
162165
LOOP
163166
EXECUTE
164167
format('SELECT @extschema@.create_single_range_partition($1, $2, $3::%s, tablespace:=$4)',
165-
@extschema@.get_base_type(pg_typeof(p_start_value))::TEXT)
168+
v_atttype::TEXT)
166169
USING
167170
parent_relid,
168171
p_start_value,
@@ -831,15 +834,18 @@ RETURNS TEXT AS
831834
$$
832835
DECLARE
833836
v_part_name TEXT;
837+
v_atttype REGTYPE;
834838

835839
BEGIN
836840
IF @extschema@.partitions_count(parent_relid) = 0 THEN
837841
RAISE EXCEPTION 'cannot append to empty partitions set';
838842
END IF;
839843

844+
v_atttype := @extschema@.get_base_type(p_atttype);
845+
840846
/* We have to pass fake NULL casted to column's type */
841847
EXECUTE format('SELECT @extschema@.get_part_range($1, -1, NULL::%s)',
842-
@extschema@.get_base_type(p_atttype)::TEXT)
848+
v_atttype::TEXT)
843849
USING parent_relid
844850
INTO p_range;
845851

@@ -853,7 +859,7 @@ BEGIN
853859
ELSE
854860
EXECUTE
855861
format('SELECT @extschema@.create_single_range_partition($1, $2, $2 + $3::%s, $4, $5)',
856-
@extschema@.get_base_type(p_atttype)::TEXT)
862+
v_atttype::TEXT)
857863
USING
858864
parent_relid,
859865
p_range[2],
@@ -933,15 +939,18 @@ RETURNS TEXT AS
933939
$$
934940
DECLARE
935941
v_part_name TEXT;
942+
v_atttype REGTYPE;
936943

937944
BEGIN
938945
IF @extschema@.partitions_count(parent_relid) = 0 THEN
939946
RAISE EXCEPTION 'cannot prepend to empty partitions set';
940947
END IF;
941948

949+
v_atttype := @extschema@.get_base_type(p_atttype);
950+
942951
/* We have to pass fake NULL casted to column's type */
943952
EXECUTE format('SELECT @extschema@.get_part_range($1, 0, NULL::%s)',
944-
@extschema@.get_base_type(p_atttype)::TEXT)
953+
v_atttype::TEXT)
945954
USING parent_relid
946955
INTO p_range;
947956

@@ -955,7 +964,7 @@ BEGIN
955964
ELSE
956965
EXECUTE
957966
format('SELECT @extschema@.create_single_range_partition($1, $2 - $3::%s, $2, $4, $5)',
958-
@extschema@.get_base_type(p_atttype)::TEXT)
967+
v_atttype::TEXT)
959968
USING
960969
parent_relid,
961970
p_range[1],
@@ -1117,7 +1126,7 @@ DECLARE
11171126
parent_relid REGCLASS;
11181127

11191128
BEGIN
1120-
parent_relid = @extschema@.get_parent_of_partition(p_partition);
1129+
parent_relid := @extschema@.get_parent_of_partition(p_partition);
11211130

11221131
/* Acquire lock on parent */
11231132
PERFORM @extschema@.lock_partitioned_relation(parent_relid);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy