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

Commit84fa67f

Browse files
committed
Merge branch 'rel_1_3_beta' into rel_future_beta
2 parentsb5059cd +7813e85 commit84fa67f

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

‎expected/pathman_basic.out

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2392,7 +2392,45 @@ EXPLAIN (COSTS OFF) SELECT * FROM test.index_on_childs WHERE c1 > 100 AND c1 < 2
23922392
Filter: (c1 < 2500)
23932393
(12 rows)
23942394

2395+
/* Test recursive CTE */
2396+
CREATE TABLE test.recursive_cte_test_tbl(id INT NOT NULL, name TEXT NOT NULL);
2397+
SELECT * FROM create_hash_partitions('test.recursive_cte_test_tbl', 'id', 2);
2398+
create_hash_partitions
2399+
------------------------
2400+
2
2401+
(1 row)
2402+
2403+
INSERT INTO test.recursive_cte_test_tbl (id, name) SELECT id, 'name'||id FROM generate_series(1,100) f(id);
2404+
INSERT INTO test.recursive_cte_test_tbl (id, name) SELECT id, 'name'||(id + 1) FROM generate_series(1,100) f(id);
2405+
INSERT INTO test.recursive_cte_test_tbl (id, name) SELECT id, 'name'||(id + 2) FROM generate_series(1,100) f(id);
2406+
SELECT * FROM test.recursive_cte_test_tbl WHERE id = 5;
2407+
id | name
2408+
----+-------
2409+
5 | name5
2410+
5 | name6
2411+
5 | name7
2412+
(3 rows)
2413+
2414+
WITH RECURSIVE test AS (
2415+
SELECT min(name) AS name
2416+
FROM test.recursive_cte_test_tbl
2417+
WHERE id = 5
2418+
UNION ALL
2419+
SELECT (SELECT min(name)
2420+
FROM test.recursive_cte_test_tbl
2421+
WHERE id = 5 AND name > test.name)
2422+
FROM test
2423+
WHERE name IS NOT NULL)
2424+
SELECT * FROM test;
2425+
name
2426+
-------
2427+
name5
2428+
name6
2429+
name7
2430+
2431+
(4 rows)
2432+
23952433
DROP SCHEMA test CASCADE;
2396-
NOTICE: drop cascades to51 other objects
2434+
NOTICE: drop cascades to54 other objects
23972435
DROP EXTENSION pg_pathman CASCADE;
23982436
DROP SCHEMA pathman CASCADE;

‎sql/pathman_basic.sql

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,27 @@ SELECT set_enable_parent('test.index_on_childs', true);
679679
VACUUM ANALYZEtest.index_on_childs;
680680
EXPLAIN (COSTS OFF)SELECT*FROMtest.index_on_childsWHERE c1>100AND c1<2500AND c2=500;
681681

682+
/* Test recursive CTE*/
683+
CREATETABLEtest.recursive_cte_test_tbl(idINTNOT NULL, nameTEXTNOT NULL);
684+
SELECT*FROM create_hash_partitions('test.recursive_cte_test_tbl','id',2);
685+
INSERT INTOtest.recursive_cte_test_tbl (id, name)SELECT id,'name'||idFROM generate_series(1,100) f(id);
686+
INSERT INTOtest.recursive_cte_test_tbl (id, name)SELECT id,'name'||(id+1)FROM generate_series(1,100) f(id);
687+
INSERT INTOtest.recursive_cte_test_tbl (id, name)SELECT id,'name'||(id+2)FROM generate_series(1,100) f(id);
688+
SELECT*FROMtest.recursive_cte_test_tblWHERE id=5;
689+
690+
WITH RECURSIVE testAS (
691+
SELECTmin(name)AS name
692+
FROMtest.recursive_cte_test_tbl
693+
WHERE id=5
694+
UNION ALL
695+
SELECT (SELECTmin(name)
696+
FROMtest.recursive_cte_test_tbl
697+
WHERE id=5AND name>test.name)
698+
FROM test
699+
WHERE nameIS NOT NULL)
700+
SELECT*FROM test;
701+
702+
682703
DROPSCHEMA test CASCADE;
683704
DROP EXTENSION pg_pathman CASCADE;
684705
DROPSCHEMA pathman CASCADE;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp