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

Commit1256de7

Browse files
committed
Merge branch 'rel_1_3_beta' into coveralls_support
2 parents51a84eb +a93a846 commit1256de7

27 files changed

+2046
-252
lines changed

‎Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ DATA = pg_pathman--1.0.sql \
1818
PGFILEDESC = "pg_pathman - partitioning tool"
1919

2020
REGRESS = pathman_basic\
21+
pathman_inserts\
2122
pathman_runtime_nodes\
2223
pathman_callbacks\
2324
pathman_domains\

‎expected/pathman_basic.out

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ UNION SELECT * FROM test.from_only_test;
494494
/* not ok, ONLY|non-ONLY in one query */
495495
EXPLAIN (COSTS OFF)
496496
SELECT * FROM test.from_only_test a JOIN ONLY test.from_only_test b USING(val);
497-
ERROR:It is prohibited to apply ONLY modifier to partitioned tables which have already been mentioned without ONLY
497+
ERROR:it is prohibited to apply ONLY modifier to partitioned tables which have already been mentioned without ONLY
498498
EXPLAIN (COSTS OFF)
499499
WITH q1 AS (SELECT * FROM test.from_only_test),
500500
q2 AS (SELECT * FROM ONLY test.from_only_test)
@@ -2309,7 +2309,45 @@ EXPLAIN (COSTS OFF) SELECT * FROM test.index_on_childs WHERE c1 > 100 AND c1 < 2
23092309
Filter: (c1 < 2500)
23102310
(12 rows)
23112311

2312+
/* Test recursive CTE */
2313+
CREATE TABLE test.recursive_cte_test_tbl(id INT NOT NULL, name TEXT NOT NULL);
2314+
SELECT * FROM create_hash_partitions('test.recursive_cte_test_tbl', 'id', 2);
2315+
create_hash_partitions
2316+
------------------------
2317+
2
2318+
(1 row)
2319+
2320+
INSERT INTO test.recursive_cte_test_tbl (id, name) SELECT id, 'name'||id FROM generate_series(1,100) f(id);
2321+
INSERT INTO test.recursive_cte_test_tbl (id, name) SELECT id, 'name'||(id + 1) FROM generate_series(1,100) f(id);
2322+
INSERT INTO test.recursive_cte_test_tbl (id, name) SELECT id, 'name'||(id + 2) FROM generate_series(1,100) f(id);
2323+
SELECT * FROM test.recursive_cte_test_tbl WHERE id = 5;
2324+
id | name
2325+
----+-------
2326+
5 | name5
2327+
5 | name6
2328+
5 | name7
2329+
(3 rows)
2330+
2331+
WITH RECURSIVE test AS (
2332+
SELECT min(name) AS name
2333+
FROM test.recursive_cte_test_tbl
2334+
WHERE id = 5
2335+
UNION ALL
2336+
SELECT (SELECT min(name)
2337+
FROM test.recursive_cte_test_tbl
2338+
WHERE id = 5 AND name > test.name)
2339+
FROM test
2340+
WHERE name IS NOT NULL)
2341+
SELECT * FROM test;
2342+
name
2343+
-------
2344+
name5
2345+
name6
2346+
name7
2347+
2348+
(4 rows)
2349+
23122350
DROP SCHEMA test CASCADE;
2313-
NOTICE: drop cascades to51 other objects
2351+
NOTICE: drop cascades to54 other objects
23142352
DROP EXTENSION pg_pathman CASCADE;
23152353
DROP SCHEMA pathman CASCADE;

‎expected/pathman_calamity.out

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ ALTER TABLE calamity.wrong_partition
420420
ADD CONSTRAINT pathman_wrong_partition_1_check
421421
CHECK (val < 10); /* wrong constraint */
422422
SELECT add_to_pathman_config('calamity.part_test', 'val', '10');
423-
ERROR:Wrong constraint format for RANGE partition "wrong_partition"
423+
ERROR:wrong constraint format for RANGE partition "wrong_partition"
424424
EXPLAIN (COSTS OFF) SELECT * FROM calamity.part_ok; /* check that pathman is enabled */
425425
QUERY PLAN
426426
-----------------------------
@@ -436,7 +436,7 @@ ALTER TABLE calamity.wrong_partition
436436
ADD CONSTRAINT pathman_wrong_partition_1_check
437437
CHECK (val = 1 OR val = 2); /* wrong constraint */
438438
SELECT add_to_pathman_config('calamity.part_test', 'val', '10');
439-
ERROR:Wrong constraint format for RANGE partition "wrong_partition"
439+
ERROR:wrong constraint format for RANGE partition "wrong_partition"
440440
EXPLAIN (COSTS OFF) SELECT * FROM calamity.part_ok; /* check that pathman is enabled */
441441
QUERY PLAN
442442
-----------------------------
@@ -452,7 +452,7 @@ ALTER TABLE calamity.wrong_partition
452452
ADD CONSTRAINT pathman_wrong_partition_1_check
453453
CHECK (val >= 10 AND val = 2); /* wrong constraint */
454454
SELECT add_to_pathman_config('calamity.part_test', 'val', '10');
455-
ERROR:Wrong constraint format for RANGE partition "wrong_partition"
455+
ERROR:wrong constraint format for RANGE partition "wrong_partition"
456456
EXPLAIN (COSTS OFF) SELECT * FROM calamity.part_ok; /* check that pathman is enabled */
457457
QUERY PLAN
458458
-----------------------------

‎expected/pathman_callbacks.out

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ SELECT set_init_callback('callbacks.abc',
2727

2828
INSERT INTO callbacks.abc VALUES (123, 1);
2929
INSERT INTO callbacks.abc VALUES (223, 1); /* show warning */
30-
WARNING: callback arg: {"parent": "abc", "parttype": "2", "partition": "abc_3", "range_max": "301", "range_min": "201"}
30+
WARNING: callback arg: {"parent": "abc", "parttype": "2", "partition": "abc_3", "range_max": "301", "range_min": "201", "parent_schema": "callbacks", "partition_schema": "callbacks"}
3131
SELECT set_spawn_using_bgw('callbacks.abc', true);
3232
set_spawn_using_bgw
3333
---------------------
@@ -54,21 +54,21 @@ SELECT set_spawn_using_bgw('callbacks.abc', false);
5454
(1 row)
5555

5656
SELECT append_range_partition('callbacks.abc');
57-
WARNING: callback arg: {"parent": "abc", "parttype": "2", "partition": "abc_5", "range_max": "501", "range_min": "401"}
57+
WARNING: callback arg: {"parent": "abc", "parttype": "2", "partition": "abc_5", "range_max": "501", "range_min": "401", "parent_schema": "callbacks", "partition_schema": "callbacks"}
5858
append_range_partition
5959
------------------------
6060
callbacks.abc_5
6161
(1 row)
6262

6363
SELECT prepend_range_partition('callbacks.abc');
64-
WARNING: callback arg: {"parent": "abc", "parttype": "2", "partition": "abc_6", "range_max": "1", "range_min": "-99"}
64+
WARNING: callback arg: {"parent": "abc", "parttype": "2", "partition": "abc_6", "range_max": "1", "range_min": "-99", "parent_schema": "callbacks", "partition_schema": "callbacks"}
6565
prepend_range_partition
6666
-------------------------
6767
callbacks.abc_6
6868
(1 row)
6969

7070
SELECT add_range_partition('callbacks.abc', 501, 602);
71-
WARNING: callback arg: {"parent": "abc", "parttype": "2", "partition": "abc_7", "range_max": "602", "range_min": "501"}
71+
WARNING: callback arg: {"parent": "abc", "parttype": "2", "partition": "abc_7", "range_max": "602", "range_min": "501", "parent_schema": "callbacks", "partition_schema": "callbacks"}
7272
add_range_partition
7373
---------------------
7474
callbacks.abc_7
@@ -97,16 +97,38 @@ SELECT set_init_callback('callbacks.abc',
9797
(1 row)
9898

9999
SELECT create_hash_partitions('callbacks.abc', 'a', 5);
100-
WARNING: callback arg: {"parent": "abc", "parttype": "1", "partition": "abc_0"}
101-
WARNING: callback arg: {"parent": "abc", "parttype": "1", "partition": "abc_1"}
102-
WARNING: callback arg: {"parent": "abc", "parttype": "1", "partition": "abc_2"}
103-
WARNING: callback arg: {"parent": "abc", "parttype": "1", "partition": "abc_3"}
104-
WARNING: callback arg: {"parent": "abc", "parttype": "1", "partition": "abc_4"}
100+
WARNING: callback arg: {"parent": "abc", "parttype": "1", "partition": "abc_0", "parent_schema": "callbacks", "partition_schema": "callbacks"}
101+
WARNING: callback arg: {"parent": "abc", "parttype": "1", "partition": "abc_1", "parent_schema": "callbacks", "partition_schema": "callbacks"}
102+
WARNING: callback arg: {"parent": "abc", "parttype": "1", "partition": "abc_2", "parent_schema": "callbacks", "partition_schema": "callbacks"}
103+
WARNING: callback arg: {"parent": "abc", "parttype": "1", "partition": "abc_3", "parent_schema": "callbacks", "partition_schema": "callbacks"}
104+
WARNING: callback arg: {"parent": "abc", "parttype": "1", "partition": "abc_4", "parent_schema": "callbacks", "partition_schema": "callbacks"}
105105
create_hash_partitions
106106
------------------------
107107
5
108108
(1 row)
109109

110+
DROP TABLE callbacks.abc CASCADE;
111+
NOTICE: drop cascades to 5 other objects
112+
/* create table in public schema */
113+
CREATE TABLE abc(a serial, b int);
114+
SELECT set_init_callback('abc',
115+
'callbacks.abc_on_part_created_callback');
116+
set_init_callback
117+
-------------------
118+
119+
(1 row)
120+
121+
SELECT create_range_partitions('abc', 'a', 1, 100, 2);
122+
NOTICE: sequence "abc_seq" does not exist, skipping
123+
WARNING: callback arg: {"parent": "abc", "parttype": "2", "partition": "abc_1", "range_max": "101", "range_min": "1", "parent_schema": "public", "partition_schema": "public"}
124+
WARNING: callback arg: {"parent": "abc", "parttype": "2", "partition": "abc_2", "range_max": "201", "range_min": "101", "parent_schema": "public", "partition_schema": "public"}
125+
create_range_partitions
126+
-------------------------
127+
2
128+
(1 row)
129+
130+
DROP TABLE abc CASCADE;
131+
NOTICE: drop cascades to 2 other objects
110132
DROP SCHEMA callbacks CASCADE;
111-
NOTICE: drop cascades to8 other objects
133+
NOTICE: drop cascades to2 other objects
112134
DROP EXTENSION pg_pathman CASCADE;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp