mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
Fix EXPLAIN ANALYZE SELECT INTO not to choose a parallel plan.
We don't support any parallel write operations at present, so choosing a parallel plan causes us to error out. Also, add a new regression test 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
This commit is contained in:
parent
5864d6a4b6
commit
270b7daf5c
@ -347,7 +347,7 @@ ExplainOneQuery(Query *query, IntoClause *into, ExplainState *es,
|
|||||||
INSTR_TIME_SET_CURRENT(planstart);
|
INSTR_TIME_SET_CURRENT(planstart);
|
||||||
|
|
||||||
/* plan the query */
|
/* plan the query */
|
||||||
plan = pg_plan_query(query, CURSOR_OPT_PARALLEL_OK, params);
|
plan = pg_plan_query(query, into ? 0 : CURSOR_OPT_PARALLEL_OK, params);
|
||||||
|
|
||||||
INSTR_TIME_SET_CURRENT(planduration);
|
INSTR_TIME_SET_CURRENT(planduration);
|
||||||
INSTR_TIME_SUBTRACT(planduration, planstart);
|
INSTR_TIME_SUBTRACT(planduration, planstart);
|
||||||
|
@ -74,7 +74,14 @@ SELECT * FROM created_table;
|
|||||||
4567890123456789 | -4567890123456789
|
4567890123456789 | -4567890123456789
|
||||||
(5 rows)
|
(5 rows)
|
||||||
|
|
||||||
|
-- Try EXPLAIN ANALYZE SELECT INTO, but hide the output since it won't
|
||||||
|
-- be stable.
|
||||||
|
DO $$
|
||||||
|
BEGIN
|
||||||
|
EXECUTE 'EXPLAIN ANALYZE SELECT * INTO TABLE easi FROM int8_tbl';
|
||||||
|
END$$;
|
||||||
DROP TABLE created_table;
|
DROP TABLE created_table;
|
||||||
|
DROP TABLE easi;
|
||||||
--
|
--
|
||||||
-- Disallowed uses of SELECT ... INTO. All should fail
|
-- Disallowed uses of SELECT ... INTO. All should fail
|
||||||
--
|
--
|
||||||
|
@ -66,7 +66,15 @@ SELECT make_table();
|
|||||||
|
|
||||||
SELECT * FROM created_table;
|
SELECT * FROM created_table;
|
||||||
|
|
||||||
|
-- Try EXPLAIN ANALYZE SELECT INTO, but hide the output since it won't
|
||||||
|
-- be stable.
|
||||||
|
DO $$
|
||||||
|
BEGIN
|
||||||
|
EXECUTE 'EXPLAIN ANALYZE SELECT * INTO TABLE easi FROM int8_tbl';
|
||||||
|
END$$;
|
||||||
|
|
||||||
DROP TABLE created_table;
|
DROP TABLE created_table;
|
||||||
|
DROP TABLE easi;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Disallowed uses of SELECT ... INTO. All should fail
|
-- Disallowed uses of SELECT ... INTO. All should fail
|
||||||
|
Loading…
x
Reference in New Issue
Block a user