2016-06-08 05:36:22 +02:00
|
|
|
--
|
|
|
|
-- PARALLEL
|
|
|
|
--
|
|
|
|
-- Serializable isolation would disable parallel query, so explicitly use an
|
|
|
|
-- arbitrary other level.
|
|
|
|
begin isolation level repeatable read;
|
|
|
|
-- setup parallel test
|
|
|
|
set parallel_setup_cost=0;
|
|
|
|
set parallel_tuple_cost=0;
|
|
|
|
explain (costs off)
|
|
|
|
select count(*) from a_star;
|
|
|
|
QUERY PLAN
|
|
|
|
-----------------------------------------------------
|
|
|
|
Finalize Aggregate
|
|
|
|
-> Gather
|
|
|
|
Workers Planned: 1
|
|
|
|
-> Partial Aggregate
|
|
|
|
-> Append
|
|
|
|
-> Parallel Seq Scan on a_star
|
|
|
|
-> Parallel Seq Scan on b_star
|
|
|
|
-> Parallel Seq Scan on c_star
|
|
|
|
-> Parallel Seq Scan on d_star
|
|
|
|
-> Parallel Seq Scan on e_star
|
|
|
|
-> Parallel Seq Scan on f_star
|
|
|
|
(11 rows)
|
|
|
|
|
|
|
|
select count(*) from a_star;
|
|
|
|
count
|
|
|
|
-------
|
|
|
|
50
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
set force_parallel_mode=1;
|
|
|
|
explain (costs off)
|
|
|
|
select stringu1::int2 from tenk1 where unique1 = 1;
|
|
|
|
QUERY PLAN
|
|
|
|
-----------------------------------------------
|
|
|
|
Gather
|
|
|
|
Workers Planned: 1
|
|
|
|
Single Copy: true
|
|
|
|
-> Index Scan using tenk1_unique1 on tenk1
|
|
|
|
Index Cond: (unique1 = 1)
|
|
|
|
(5 rows)
|
|
|
|
|
|
|
|
do $$begin
|
|
|
|
-- Provoke error in worker. The original message CONTEXT contains a worker
|
2016-06-15 20:59:07 +02:00
|
|
|
-- PID that must be hidden in the test output.
|
|
|
|
perform stringu1::int2 from tenk1 where unique1 = 1;
|
|
|
|
exception
|
|
|
|
when others then
|
|
|
|
raise 'SQLERRM: %', sqlerrm;
|
2016-06-08 05:36:22 +02:00
|
|
|
end$$;
|
2016-06-15 20:59:07 +02:00
|
|
|
ERROR: SQLERRM: invalid input syntax for integer: "BAAAAA"
|
|
|
|
CONTEXT: PL/pgSQL function inline_code_block line 7 at RAISE
|
2016-06-08 05:36:22 +02:00
|
|
|
rollback;
|