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

Commit270b7da

Browse files
committed
Fix EXPLAIN ANALYZE SELECT INTO not to choose a parallel plan.
We don't support any parallel write operations at present, so choosinga parallel plan causes us to error out. Also, add a new regressiontest that uses EXPLAIN ANALYZE SELECT INTO; if we'd had this previously,force_parallel_mode testing would have caught this issue.Mithun Cy and Robert Haas
1 parent5864d6a commit270b7da

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

‎src/backend/commands/explain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ ExplainOneQuery(Query *query, IntoClause *into, ExplainState *es,
347347
INSTR_TIME_SET_CURRENT(planstart);
348348

349349
/* plan the query */
350-
plan=pg_plan_query(query,CURSOR_OPT_PARALLEL_OK,params);
350+
plan=pg_plan_query(query,into ?0 :CURSOR_OPT_PARALLEL_OK,params);
351351

352352
INSTR_TIME_SET_CURRENT(planduration);
353353
INSTR_TIME_SUBTRACT(planduration,planstart);

‎src/test/regress/expected/select_into.out

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,14 @@ SELECT * FROM created_table;
7474
4567890123456789 | -4567890123456789
7575
(5 rows)
7676

77+
-- Try EXPLAIN ANALYZE SELECT INTO, but hide the output since it won't
78+
-- be stable.
79+
DO $$
80+
BEGIN
81+
EXECUTE 'EXPLAIN ANALYZE SELECT * INTO TABLE easi FROM int8_tbl';
82+
END$$;
7783
DROP TABLE created_table;
84+
DROP TABLE easi;
7885
--
7986
-- Disallowed uses of SELECT ... INTO. All should fail
8087
--

‎src/test/regress/sql/select_into.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,15 @@ SELECT make_table();
6666

6767
SELECT*FROM created_table;
6868

69+
-- Try EXPLAIN ANALYZE SELECT INTO, but hide the output since it won't
70+
-- be stable.
71+
DO $$
72+
BEGIN
73+
EXECUTE'EXPLAIN ANALYZE SELECT * INTO TABLE easi FROM int8_tbl';
74+
END$$;
75+
6976
DROPTABLE created_table;
77+
DROPTABLE easi;
7078

7179
--
7280
-- Disallowed uses of SELECT ... INTO. All should fail

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp