postgresql/contrib/auto_explain/sql/extension_options.sql
Robert Haas e972dff6c3 auto_explain: Add new GUC, auto_explain.log_extension_options.
The associated value should look like something that could be
part of an EXPLAIN options list, but restricted to EXPLAIN options
added by extensions.

For example, if pg_overexplain is loaded, you could set
auto_explain.log_extension_options = 'DEBUG, RANGE_TABLE'.
You can also specify arguments to these options in the same manner
as normal e.g. 'DEBUG 1, RANGE_TABLE false'.

Reviewed-by: Matheus Alcantara <matheusssilv97@gmail.com>
Reviewed-by: Lukas Fittl <lukas@fittl.com>
Discussion: http://postgr.es/m/CA+Tgmob-0W8306mvrJX5Urtqt1AAasu8pi4yLrZ1XfwZU-Uj1w@mail.gmail.com
2026-04-06 15:19:42 -04:00

33 lines
1.5 KiB
SQL

--
-- Tests for auto_explain.log_extension_options.
--
LOAD 'auto_explain';
LOAD 'pg_overexplain';
-- Various legal values with assorted quoting and whitespace choices.
SET auto_explain.log_extension_options = '';
SET auto_explain.log_extension_options = 'debug, RANGE_TABLE';
SET auto_explain.log_extension_options = 'debug TRUE ';
SET auto_explain.log_extension_options = ' debug 1,RAnge_table "off"';
SET auto_explain.log_extension_options = $$"debug" tRuE, range_table 'false'$$;
-- Syntax errors.
SET auto_explain.log_extension_options = ',';
SET auto_explain.log_extension_options = ', range_table';
SET auto_explain.log_extension_options = 'range_table, ';
SET auto_explain.log_extension_options = 'range_table true false';
SET auto_explain.log_extension_options = '"range_table';
SET auto_explain.log_extension_options = 'range_table 3.1415nine';
SET auto_explain.log_extension_options = 'range_table "true';
SET auto_explain.log_extension_options = $$range_table 'true$$;
SET auto_explain.log_extension_options = $$'$$;
-- Unacceptable option values.
SET auto_explain.log_extension_options = 'range_table maybe';
SET auto_explain.log_extension_options = 'range_table 2';
SET auto_explain.log_extension_options = 'range_table "0"';
SET auto_explain.log_extension_options = 'range_table 3.14159';
-- Supply enough options to force the option array to be reallocated.
SET auto_explain.log_extension_options = 'debug, debug, debug, debug, debug, debug, debug, debug, debug, debug false';