Skip to content

Commit b17fdf2

Browse files
committed
Fix regression tests for <=14
1 parent 40564ad commit b17fdf2

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed

expected/formats_2.out

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
-- explain output on PG12/13 is missing "Async Capable"
2+
select setting::int < 140000 as pg12_13 from pg_settings where name = 'server_version_num';
3+
pg12_13
4+
---------
5+
f
6+
(1 row)
7+
8+
-- json output
9+
set pg_show_plans.plan_format = 'json';
10+
ERROR: parameter "pg_show_plans.plan_format" cannot be changed without restarting the server
11+
show pg_show_plans.plan_format;
12+
pg_show_plans.plan_format
13+
---------------------------
14+
text
15+
(1 row)
16+
17+
select * from nest();
18+
level | plan
19+
-------+------
20+
(0 rows)
21+
22+
-- yaml output
23+
set pg_show_plans.plan_format = 'yaml';
24+
ERROR: parameter "pg_show_plans.plan_format" cannot be changed without restarting the server
25+
show pg_show_plans.plan_format;
26+
pg_show_plans.plan_format
27+
---------------------------
28+
text
29+
(1 row)
30+
31+
select * from nest();
32+
level | plan
33+
-------+------
34+
(0 rows)
35+
36+
-- xml output
37+
set pg_show_plans.plan_format = 'xml';
38+
ERROR: parameter "pg_show_plans.plan_format" cannot be changed without restarting the server
39+
show pg_show_plans.plan_format;
40+
pg_show_plans.plan_format
41+
---------------------------
42+
text
43+
(1 row)
44+
45+
select * from nest();
46+
level | plan
47+
-------+------
48+
(0 rows)
49+
50+
-- check plan format after reconnect
51+
\c
52+
show pg_show_plans.plan_format;
53+
pg_show_plans.plan_format
54+
---------------------------
55+
text
56+
(1 row)
57+

expected/pg_show_plans_1.out

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
create extension pg_show_plans;
2+
show pg_show_plans.is_enabled;
3+
pg_show_plans.is_enabled
4+
--------------------------
5+
off
6+
(1 row)
7+
8+
show pg_show_plans.max_plan_length;
9+
pg_show_plans.max_plan_length
10+
-------------------------------
11+
16384
12+
(1 row)
13+
14+
create function nest()
15+
returns table (level int, plan text)
16+
language plpgsql
17+
as $$
18+
begin
19+
return query
20+
select pg_show_plans.level, pg_show_plans.plan from pg_show_plans
21+
where pg_show_plans.level >= 0;
22+
end;
23+
$$;
24+
-- text output
25+
set pg_show_plans.plan_format = 'text';
26+
ERROR: parameter "pg_show_plans.plan_format" cannot be changed without restarting the server
27+
show pg_show_plans.plan_format;
28+
pg_show_plans.plan_format
29+
---------------------------
30+
text
31+
(1 row)
32+
33+
select level, plan from pg_show_plans;
34+
level | plan
35+
-------+------
36+
(0 rows)
37+
38+
select * from nest();
39+
level | plan
40+
-------+------
41+
(0 rows)
42+

0 commit comments

Comments
 (0)