File tree Expand file tree Collapse file tree 2 files changed +99
-0
lines changed Expand file tree Collapse file tree 2 files changed +99
-0
lines changed Original file line number Diff line number Diff line change 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+
Original file line number Diff line number Diff line change 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+
You can’t perform that action at this time.
0 commit comments