Skip to content

Commit 98c2578

Browse files
committed
merge branch rel_1_1_beta (resolve conflicts), restore function validate_relname()
2 parents f5fb6e9 + ba968fe commit 98c2578

21 files changed

+767
-285
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

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ REGRESS = pathman_basic \
1717
pathman_callbacks \
1818
pathman_domains \
1919
pathman_foreign_keys \
20-
pathman_permissions
20+
pathman_permissions \
21+
pathman_rowmarks
2122
EXTRA_REGRESS_OPTS=--temp-config=$(top_srcdir)/$(subdir)/conf.add
2223
EXTRA_CLEAN = $(EXTENSION)--$(EXTVERSION).sql ./isolation_output
2324

README.md

Lines changed: 175 additions & 53 deletions
Large diffs are not rendered by default.

expected/pathman_basic.out

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -889,9 +889,9 @@ SELECT * FROM test.hash_rel WHERE id = 123;
889889
*/
890890
SELECT pathman.drop_partitions('test.hash_rel');
891891
NOTICE: drop cascades to 3 other objects
892-
NOTICE: 2 rows copied from test.hash_rel_2
893-
NOTICE: 3 rows copied from test.hash_rel_1
894892
NOTICE: 2 rows copied from test.hash_rel_0
893+
NOTICE: 3 rows copied from test.hash_rel_1
894+
NOTICE: 2 rows copied from test.hash_rel_2
895895
drop_partitions
896896
-----------------
897897
3
@@ -925,11 +925,11 @@ SELECT COUNT(*) FROM ONLY test.hash_rel;
925925
DROP TABLE test.hash_rel CASCADE;
926926
SELECT pathman.drop_partitions('test.num_range_rel');
927927
NOTICE: drop cascades to 4 other objects
928-
NOTICE: 0 rows copied from test.num_range_rel_6
929-
NOTICE: 2 rows copied from test.num_range_rel_4
930-
NOTICE: 1000 rows copied from test.num_range_rel_3
931-
NOTICE: 1000 rows copied from test.num_range_rel_2
932928
NOTICE: 998 rows copied from test.num_range_rel_1
929+
NOTICE: 1000 rows copied from test.num_range_rel_2
930+
NOTICE: 1000 rows copied from test.num_range_rel_3
931+
NOTICE: 2 rows copied from test.num_range_rel_4
932+
NOTICE: 0 rows copied from test.num_range_rel_6
933933
drop_partitions
934934
-----------------
935935
5
@@ -1108,9 +1108,9 @@ EXPLAIN (COSTS OFF) SELECT * FROM test."TeSt" WHERE a = 1;
11081108

11091109
SELECT pathman.drop_partitions('test."TeSt"');
11101110
NOTICE: drop cascades to 3 other objects
1111-
NOTICE: 3 rows copied from test."TeSt_2"
1112-
NOTICE: 0 rows copied from test."TeSt_1"
11131111
NOTICE: 0 rows copied from test."TeSt_0"
1112+
NOTICE: 0 rows copied from test."TeSt_1"
1113+
NOTICE: 3 rows copied from test."TeSt_2"
11141114
drop_partitions
11151115
-----------------
11161116
3
@@ -1163,11 +1163,11 @@ SELECT pathman.split_range_partition('test."RangeRel_1"', '2015-01-01'::DATE);
11631163

11641164
SELECT pathman.drop_partitions('test."RangeRel"');
11651165
NOTICE: function test.RangeRel_upd_trig_func() does not exist, skipping
1166-
NOTICE: 1 rows copied from test."RangeRel_6"
1167-
NOTICE: 0 rows copied from test."RangeRel_4"
1168-
NOTICE: 1 rows copied from test."RangeRel_3"
1169-
NOTICE: 1 rows copied from test."RangeRel_2"
11701166
NOTICE: 0 rows copied from test."RangeRel_1"
1167+
NOTICE: 1 rows copied from test."RangeRel_2"
1168+
NOTICE: 1 rows copied from test."RangeRel_3"
1169+
NOTICE: 0 rows copied from test."RangeRel_4"
1170+
NOTICE: 1 rows copied from test."RangeRel_6"
11711171
drop_partitions
11721172
-----------------
11731173
5
@@ -1199,9 +1199,9 @@ SELECT pathman.create_range_partitions('test."RangeRel"', 'id', 1, 100, 3);
11991199

12001200
SELECT pathman.drop_partitions('test."RangeRel"');
12011201
NOTICE: function test.RangeRel_upd_trig_func() does not exist, skipping
1202-
NOTICE: 0 rows copied from test."RangeRel_3"
1203-
NOTICE: 0 rows copied from test."RangeRel_2"
12041202
NOTICE: 0 rows copied from test."RangeRel_1"
1203+
NOTICE: 0 rows copied from test."RangeRel_2"
1204+
NOTICE: 0 rows copied from test."RangeRel_3"
12051205
drop_partitions
12061206
-----------------
12071207
3
@@ -1358,20 +1358,20 @@ DELETE FROM range_rel r USING tmp t WHERE r.dt = '2010-01-02' AND r.id = t.id;
13581358
/* Create range partitions from whole range */
13591359
SELECT drop_partitions('range_rel');
13601360
NOTICE: function public.range_rel_upd_trig_func() does not exist, skipping
1361-
NOTICE: 0 rows copied from range_rel_15
1362-
NOTICE: 0 rows copied from range_rel_14
1363-
NOTICE: 14 rows copied from range_rel_13
1364-
NOTICE: 31 rows copied from range_rel_12
1365-
NOTICE: 30 rows copied from range_rel_11
1366-
NOTICE: 31 rows copied from range_rel_10
1367-
NOTICE: 30 rows copied from range_rel_9
1368-
NOTICE: 31 rows copied from range_rel_8
1369-
NOTICE: 31 rows copied from range_rel_7
1370-
NOTICE: 29 rows copied from range_rel_6
1371-
NOTICE: 31 rows copied from range_rel_5
1372-
NOTICE: 30 rows copied from range_rel_4
1373-
NOTICE: 31 rows copied from range_rel_3
13741361
NOTICE: 44 rows copied from range_rel_1
1362+
NOTICE: 31 rows copied from range_rel_3
1363+
NOTICE: 30 rows copied from range_rel_4
1364+
NOTICE: 31 rows copied from range_rel_5
1365+
NOTICE: 29 rows copied from range_rel_6
1366+
NOTICE: 31 rows copied from range_rel_7
1367+
NOTICE: 31 rows copied from range_rel_8
1368+
NOTICE: 30 rows copied from range_rel_9
1369+
NOTICE: 31 rows copied from range_rel_10
1370+
NOTICE: 30 rows copied from range_rel_11
1371+
NOTICE: 31 rows copied from range_rel_12
1372+
NOTICE: 14 rows copied from range_rel_13
1373+
NOTICE: 0 rows copied from range_rel_14
1374+
NOTICE: 0 rows copied from range_rel_15
13751375
drop_partitions
13761376
-----------------
13771377
14

expected/pathman_callbacks.out

Lines changed: 19 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,11 @@
22
CREATE EXTENSION pg_pathman;
33
CREATE SCHEMA callbacks;
44
/* Check callbacks */
5-
CREATE TABLE callbacks.log(id serial, message text);
6-
CREATE OR REPLACE FUNCTION callbacks.abc_on_part_created_range_callback(
5+
CREATE OR REPLACE FUNCTION callbacks.abc_on_part_created_callback(
76
args JSONB)
87
RETURNS VOID AS $$
9-
DECLARE
10-
start_value TEXT := args->>'start';
11-
end_value TEXT := args->'end';
128
BEGIN
13-
INSERT INTO callbacks.log(message)
14-
VALUES (start_value || '-' || end_value);
15-
END
16-
$$ language plpgsql;
17-
CREATE OR REPLACE FUNCTION callbacks.abc_on_part_created_hash_callback(
18-
args JSONB)
19-
RETURNS VOID AS $$
20-
BEGIN
21-
RAISE WARNING 'callback: partition %', args->'partition';
9+
RAISE WARNING 'callback arg: %', args::TEXT;
2210
END
2311
$$ language plpgsql;
2412
/* set callback to be called on RANGE partitions */
@@ -30,42 +18,36 @@ NOTICE: sequence "abc_seq" does not exist, skipping
3018
2
3119
(1 row)
3220

33-
SELECT set_part_init_callback('callbacks.abc',
34-
'callbacks.abc_on_part_created_range_callback');
35-
set_part_init_callback
36-
------------------------
21+
SELECT set_init_callback('callbacks.abc',
22+
'callbacks.abc_on_part_created_callback');
23+
set_init_callback
24+
-------------------
3725

3826
(1 row)
3927

4028
INSERT INTO callbacks.abc VALUES (123, 1);
4129
INSERT INTO callbacks.abc VALUES (223, 1);
4230
SELECT append_range_partition('callbacks.abc');
31+
WARNING: callback arg: {"parent": "abc", "parttype": "2", "partition": "abc_4", "range_max": "401", "range_min": "301"}
4332
append_range_partition
4433
------------------------
4534
callbacks.abc_4
4635
(1 row)
4736

4837
SELECT prepend_range_partition('callbacks.abc');
38+
WARNING: callback arg: {"parent": "abc", "parttype": "2", "partition": "abc_5", "range_max": "1", "range_min": "-99"}
4939
prepend_range_partition
5040
-------------------------
5141
callbacks.abc_5
5242
(1 row)
5343

5444
SELECT add_range_partition('callbacks.abc', 401, 502);
45+
WARNING: callback arg: {"parent": "abc", "parttype": "2", "partition": "abc_6", "range_max": "502", "range_min": "401"}
5546
add_range_partition
5647
---------------------
5748
callbacks.abc_6
5849
(1 row)
5950

60-
SELECT message FROM callbacks.log ORDER BY id;
61-
message
62-
-----------
63-
201-"301"
64-
301-"401"
65-
-99-"1"
66-
401-"502"
67-
(4 rows)
68-
6951
SELECT drop_partitions('callbacks.abc');
7052
NOTICE: function callbacks.abc_upd_trig_func() does not exist, skipping
7153
NOTICE: 0 rows copied from callbacks.abc_1
@@ -80,24 +62,24 @@ NOTICE: 0 rows copied from callbacks.abc_6
8062
(1 row)
8163

8264
/* set callback to be called on HASH partitions */
83-
SELECT set_part_init_callback('callbacks.abc',
84-
'callbacks.abc_on_part_created_hash_callback');
85-
set_part_init_callback
86-
------------------------
65+
SELECT set_init_callback('callbacks.abc',
66+
'callbacks.abc_on_part_created_callback');
67+
set_init_callback
68+
-------------------
8769

8870
(1 row)
8971

9072
SELECT create_hash_partitions('callbacks.abc', 'a', 5);
91-
WARNING: callback: partition "abc_0"
92-
WARNING: callback: partition "abc_1"
93-
WARNING: callback: partition "abc_2"
94-
WARNING: callback: partition "abc_3"
95-
WARNING: callback: partition "abc_4"
73+
WARNING: callback arg: {"parent": "abc", "parttype": "1", "partition": "abc_0"}
74+
WARNING: callback arg: {"parent": "abc", "parttype": "1", "partition": "abc_1"}
75+
WARNING: callback arg: {"parent": "abc", "parttype": "1", "partition": "abc_2"}
76+
WARNING: callback arg: {"parent": "abc", "parttype": "1", "partition": "abc_3"}
77+
WARNING: callback arg: {"parent": "abc", "parttype": "1", "partition": "abc_4"}
9678
create_hash_partitions
9779
------------------------
9880
5
9981
(1 row)
10082

10183
DROP SCHEMA callbacks CASCADE;
102-
NOTICE: drop cascades to 10 other objects
84+
NOTICE: drop cascades to 8 other objects
10385
DROP EXTENSION pg_pathman CASCADE;

0 commit comments

Comments
 (0)