public inbox for [email protected]help / color / mirror / Atom feed
[PATCH v5 4/8] Examples in the documentation now use EXEC 21+ messages / 6 participants [nested] [flat]
* [PATCH v5 4/8] Examples in the documentation now use EXEC @ 2019-05-15 05:51 David Fetter <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: David Fetter @ 2019-05-15 05:51 UTC (permalink / raw) diff --git a/doc/src/sgml/auto-explain.sgml b/doc/src/sgml/auto-explain.sgml index 3d619d4a3d..3025a57232 100644 --- a/doc/src/sgml/auto-explain.sgml +++ b/doc/src/sgml/auto-explain.sgml @@ -65,14 +65,14 @@ LOAD 'auto_explain'; <varlistentry> <term> - <varname>auto_explain.log_analyze</varname> (<type>boolean</type>) + <varname>auto_explain.log_exec</varname> (<type>boolean</type>) <indexterm> - <primary><varname>auto_explain.log_analyze</varname> configuration parameter</primary> + <primary><varname>auto_explain.log_exec</varname> configuration parameter</primary> </indexterm> </term> <listitem> <para> - <varname>auto_explain.log_analyze</varname> causes <command>EXPLAIN ANALYZE</command> + <varname>auto_explain.log_exec</varname> causes <command>EXPLAIN EXEC</command> output, rather than just <command>EXPLAIN</command> output, to be printed when an execution plan is logged. This parameter is off by default. Only superusers can change this setting. @@ -102,7 +102,7 @@ LOAD 'auto_explain'; usage statistics are printed when an execution plan is logged; it's equivalent to the <literal>BUFFERS</literal> option of <command>EXPLAIN</command>. This parameter has no effect - unless <varname>auto_explain.log_analyze</varname> is enabled. + unless <varname>auto_explain.log_exec</varname> is enabled. This parameter is off by default. Only superusers can change this setting. </para> @@ -126,7 +126,7 @@ LOAD 'auto_explain'; parameter to off when only actual row counts, and not exact times, are needed. This parameter has no effect - unless <varname>auto_explain.log_analyze</varname> is enabled. + unless <varname>auto_explain.log_exec</varname> is enabled. This parameter is on by default. Only superusers can change this setting. </para> @@ -145,7 +145,7 @@ LOAD 'auto_explain'; <varname>auto_explain.log_triggers</varname> causes trigger execution statistics to be included when an execution plan is logged. This parameter has no effect - unless <varname>auto_explain.log_analyze</varname> is enabled. + unless <varname>auto_explain.log_exec</varname> is enabled. This parameter is off by default. Only superusers can change this setting. </para> @@ -283,7 +283,7 @@ auto_explain.log_min_duration = '3s' <programlisting> postgres=# LOAD 'auto_explain'; postgres=# SET auto_explain.log_min_duration = 0; -postgres=# SET auto_explain.log_analyze = true; +postgres=# SET auto_explain.log_exec = true; postgres=# SELECT count(*) FROM pg_class, pg_index WHERE oid = indrelid AND indisunique; diff --git a/doc/src/sgml/bloom.sgml b/doc/src/sgml/bloom.sgml index 6eeaddee09..5b4ede2db1 100644 --- a/doc/src/sgml/bloom.sgml +++ b/doc/src/sgml/bloom.sgml @@ -129,7 +129,7 @@ CREATE INDEX <para> A sequential scan over this large table takes a long time: <programlisting> -=# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451; +=# EXPLAIN EXEC SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451; QUERY PLAN ------------------------------------------------------------------------------------------------------------ Seq Scan on tbloom (cost=0.00..213694.08 rows=1 width=24) (actual time=1445.438..1445.438 rows=0 loops=1) @@ -145,7 +145,7 @@ CREATE INDEX So the planner will usually select an index scan if possible. With a btree index, we get results like this: <programlisting> -=# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451; +=# EXPLAIN EXEC SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------- Index Only Scan using btreeidx on tbloom (cost=0.56..298311.96 rows=1 width=24) (actual time=445.709..445.709 rows=0 loops=1) @@ -160,7 +160,7 @@ CREATE INDEX <para> Bloom is better than btree in handling this type of search: <programlisting> -=# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451; +=# EXPLAIN EXEC SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- Bitmap Heap Scan on tbloom (cost=178435.39..178439.41 rows=1 width=24) (actual time=76.698..76.698 rows=0 loops=1) @@ -187,7 +187,7 @@ CREATE INDEX A better strategy for btree is to create a separate index on each column. Then the planner will choose something like this: <programlisting> -=# EXPLAIN ANALYZE SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451; +=# EXPLAIN EXEC SELECT * FROM tbloom WHERE i2 = 898732 AND i5 = 123451; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------ Bitmap Heap Scan on tbloom (cost=9.29..13.30 rows=1 width=24) (actual time=0.148..0.148 rows=0 loops=1) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 84341a30e5..41e9a64182 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -6441,7 +6441,7 @@ log_line_prefix = '%m [%p] %q%u@%d/%a ' <command>UPDATE</command>, <command>DELETE</command>, <command>TRUNCATE</command>, and <command>COPY FROM</command>. <command>PREPARE</command>, <command>EXECUTE</command>, and - <command>EXPLAIN ANALYZE</command> statements are also logged if their + <command>EXPLAIN EXEC</command> statements are also logged if their contained command is of an appropriate type. For clients using extended query protocol, logging occurs when an Execute message is received, and values of the Bind parameters are included diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml index a0a7435a03..407f94dfbe 100644 --- a/doc/src/sgml/ddl.sgml +++ b/doc/src/sgml/ddl.sgml @@ -4498,7 +4498,7 @@ EXPLAIN SELECT count(*) FROM measurement WHERE logdate >= DATE '2008-01-01'; performed here for parameter values which are known during the initialization phase of execution. Partitions which are pruned during this stage will not show up in the query's - <command>EXPLAIN</command> or <command>EXPLAIN ANALYZE</command>. + <command>EXPLAIN</command> or <command>EXPLAIN EXEC</command>. It is possible to determine the number of partitions which were removed during this phase by observing the <quote>Subplans Removed</quote> property in the @@ -4518,7 +4518,7 @@ EXPLAIN SELECT count(*) FROM measurement WHERE logdate >= DATE '2008-01-01'; execution parameters being used by partition pruning changes. Determining if partitions were pruned during this phase requires careful inspection of the <literal>loops</literal> property in - the <command>EXPLAIN ANALYZE</command> output. Subplans + the <command>EXPLAIN EXEC</command> output. Subplans corresponding to different partitions may have different values for it depending on how many times each of them was pruned during execution. Some may be shown as <literal>(never executed)</literal> diff --git a/doc/src/sgml/fdwhandler.sgml b/doc/src/sgml/fdwhandler.sgml index 27b94fb611..0f1e80b3b9 100644 --- a/doc/src/sgml/fdwhandler.sgml +++ b/doc/src/sgml/fdwhandler.sgml @@ -937,7 +937,7 @@ IterateDirectModify(ForeignScanState *node); Whether the query has the clause or not, the query's reported row count must be incremented by the FDW itself. When the query doesn't have the clause, the FDW must also increment the row count for the - <structname>ForeignScanState</structname> node in the <command>EXPLAIN ANALYZE</command> + <structname>ForeignScanState</structname> node in the <command>EXPLAIN EXEC</command> case. </para> @@ -1123,7 +1123,7 @@ ExplainForeignScan(ForeignScanState *node, The flag fields in <literal>es</literal> can be used to determine what to print, and the state of the <structname>ForeignScanState</structname> node can be inspected to provide run-time statistics in the <command>EXPLAIN - ANALYZE</command> case. + EXEC</command> case. </para> <para> @@ -1148,7 +1148,7 @@ ExplainForeignModify(ModifyTableState *mtstate, The flag fields in <literal>es</literal> can be used to determine what to print, and the state of the <structname>ModifyTableState</structname> node can be inspected to provide run-time statistics in the <command>EXPLAIN - ANALYZE</command> case. The first four arguments are the same as for + EXEC</command> case. The first four arguments are the same as for <function>BeginForeignModify</function>. </para> @@ -1172,7 +1172,7 @@ ExplainDirectModify(ForeignScanState *node, The flag fields in <literal>es</literal> can be used to determine what to print, and the state of the <structname>ForeignScanState</structname> node can be inspected to provide run-time statistics in the <command>EXPLAIN - ANALYZE</command> case. + EXEC</command> case. </para> <para> diff --git a/doc/src/sgml/indices.sgml b/doc/src/sgml/indices.sgml index 95c0a1926c..decaaa6209 100644 --- a/doc/src/sgml/indices.sgml +++ b/doc/src/sgml/indices.sgml @@ -1498,7 +1498,7 @@ CREATE INDEX test1c_content_y_index ON test1c (content COLLATE "y"); possibilities: Either the system is right and using the index is indeed not appropriate, or the cost estimates of the query plans are not reflecting reality. So you should time your query with - and without indexes. The <command>EXPLAIN ANALYZE</command> + and without indexes. The <command>EXPLAIN EXEC</command> command can be useful here. </para> </listitem> diff --git a/doc/src/sgml/jit.sgml b/doc/src/sgml/jit.sgml index a21a07ef71..cb288d8b73 100644 --- a/doc/src/sgml/jit.sgml +++ b/doc/src/sgml/jit.sgml @@ -145,7 +145,7 @@ <acronym>JIT</acronym> is used or not. As an example, here is a query that is not using <acronym>JIT</acronym>: <screen> -=# EXPLAIN ANALYZE SELECT SUM(relpages) FROM pg_class; +=# EXPLAIN EXEC SELECT SUM(relpages) FROM pg_class; QUERY PLAN ------------------------------------------------------------------------------------------------------------- Aggregate (cost=16.27..16.29 rows=1 width=8) (actual time=0.303..0.303 rows=1 loops=1) @@ -161,7 +161,7 @@ <screen> =# SET jit_above_cost = 10; SET -=# EXPLAIN ANALYZE SELECT SUM(relpages) FROM pg_class; +=# EXPLAIN EXEC SELECT SUM(relpages) FROM pg_class; QUERY PLAN ------------------------------------------------------------------------------------------------------------- Aggregate (cost=16.27..16.29 rows=1 width=8) (actual time=6.049..6.049 rows=1 loops=1) diff --git a/doc/src/sgml/parallel.sgml b/doc/src/sgml/parallel.sgml index af5d48a5c7..b3e2285f05 100644 --- a/doc/src/sgml/parallel.sgml +++ b/doc/src/sgml/parallel.sgml @@ -442,7 +442,7 @@ EXPLAIN SELECT * FROM pgbench_accounts WHERE filler LIKE '%x%'; </para> <para> - When executing a parallel plan, you can use <literal>EXPLAIN (ANALYZE, + When executing a parallel plan, you can use <literal>EXPLAIN (EXEC, VERBOSE)</literal> to display per-worker statistics for each plan node. This may be useful in determining whether the work is being evenly distributed between all plan nodes and more generally in understanding the diff --git a/doc/src/sgml/perform.sgml b/doc/src/sgml/perform.sgml index a84be85159..3a890c5a71 100644 --- a/doc/src/sgml/perform.sgml +++ b/doc/src/sgml/perform.sgml @@ -533,25 +533,25 @@ WHERE t1.unique1 < 100 AND t1.unique2 = t2.unique2; which shows that the planner thinks that sorting <literal>onek</literal> by index-scanning is about 12% more expensive than sequential-scan-and-sort. Of course, the next question is whether it's right about that. - We can investigate that using <command>EXPLAIN ANALYZE</command>, as discussed + We can investigate that using <command>EXPLAIN EXEC</command>, as discussed below. </para> </sect2> - <sect2 id="using-explain-analyze"> - <title><command>EXPLAIN ANALYZE</command></title> + <sect2 id="using-explain-exec"> + <title><command>EXPLAIN EXEC</command></title> <para> It is possible to check the accuracy of the planner's estimates - by using <command>EXPLAIN</command>'s <literal>ANALYZE</literal> option. With this + by using <command>EXPLAIN</command>'s <literal>EXEC</literal> option. With this option, <command>EXPLAIN</command> actually executes the query, and then displays the true row counts and true run time accumulated within each plan node, along with the same estimates that a plain <command>EXPLAIN</command> shows. For example, we might get a result like this: <screen> -EXPLAIN ANALYZE SELECT * +EXPLAIN EXEC SELECT * FROM tenk1 t1, tenk2 t2 WHERE t1.unique1 < 10 AND t1.unique2 = t2.unique2; @@ -590,12 +590,12 @@ WHERE t1.unique1 < 10 AND t1.unique2 = t2.unique2; </para> <para> - In some cases <command>EXPLAIN ANALYZE</command> shows additional execution + In some cases <command>EXPLAIN EXEC</command> shows additional execution statistics beyond the plan node execution times and row counts. For example, Sort and Hash nodes provide extra information: <screen> -EXPLAIN ANALYZE SELECT * +EXPLAIN EXEC SELECT * FROM tenk1 t1, tenk2 t2 WHERE t1.unique1 < 100 AND t1.unique2 = t2.unique2 ORDER BY t1.fivethous; @@ -630,7 +630,7 @@ WHERE t1.unique1 < 100 AND t1.unique2 = t2.unique2 ORDER BY t1.fivethous; filter condition: <screen> -EXPLAIN ANALYZE SELECT * FROM tenk1 WHERE ten < 7; +EXPLAIN EXEC SELECT * FROM tenk1 WHERE ten < 7; QUERY PLAN --------------------------------------------------------------------------------------------------------- @@ -653,7 +653,7 @@ EXPLAIN ANALYZE SELECT * FROM tenk1 WHERE ten < 7; specific point: <screen> -EXPLAIN ANALYZE SELECT * FROM polygon_tbl WHERE f1 @> polygon '(0.5,2.0)'; +EXPLAIN EXEC SELECT * FROM polygon_tbl WHERE f1 @> polygon '(0.5,2.0)'; QUERY PLAN ------------------------------------------------------------------------------------------------------ @@ -672,7 +672,7 @@ EXPLAIN ANALYZE SELECT * FROM polygon_tbl WHERE f1 @> polygon '(0.5,2.0)'; <screen> SET enable_seqscan TO off; -EXPLAIN ANALYZE SELECT * FROM polygon_tbl WHERE f1 @> polygon '(0.5,2.0)'; +EXPLAIN EXEC SELECT * FROM polygon_tbl WHERE f1 @> polygon '(0.5,2.0)'; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------- @@ -695,7 +695,7 @@ EXPLAIN ANALYZE SELECT * FROM polygon_tbl WHERE f1 @> polygon '(0.5,2.0)'; <literal>ANALYZE</literal> to get even more run time statistics: <screen> -EXPLAIN (ANALYZE, BUFFERS) SELECT * FROM tenk1 WHERE unique1 < 100 AND unique2 > 9000; +EXPLAIN (EXEC, BUFFERS) SELECT * FROM tenk1 WHERE unique1 < 100 AND unique2 > 9000; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------- @@ -719,7 +719,7 @@ EXPLAIN (ANALYZE, BUFFERS) SELECT * FROM tenk1 WHERE unique1 < 100 AND unique </para> <para> - Keep in mind that because <command>EXPLAIN ANALYZE</command> actually + Keep in mind that because <command>EXPLAIN EXEC</command> actually runs the query, any side-effects will happen as usual, even though whatever results the query might output are discarded in favor of printing the <command>EXPLAIN</command> data. If you want to analyze a @@ -729,7 +729,7 @@ EXPLAIN (ANALYZE, BUFFERS) SELECT * FROM tenk1 WHERE unique1 < 100 AND unique <screen> BEGIN; -EXPLAIN ANALYZE UPDATE tenk1 SET hundred = hundred + 1 WHERE unique1 < 100; +EXPLAIN EXEC UPDATE tenk1 SET hundred = hundred + 1 WHERE unique1 < 100; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------- @@ -795,13 +795,13 @@ EXPLAIN UPDATE parent SET f2 = f2 + 1 WHERE f1 = 101; <para> The <literal>Planning time</literal> shown by <command>EXPLAIN - ANALYZE</command> is the time it took to generate the query plan from the + EXEC</command> is the time it took to generate the query plan from the parsed query and optimize it. It does not include parsing or rewriting. </para> <para> The <literal>Execution time</literal> shown by <command>EXPLAIN - ANALYZE</command> includes executor start-up and shut-down time, as well + EXEC</command> includes executor start-up and shut-down time, as well as the time to run any triggers that are fired, but it does not include parsing, rewriting, or planning time. Time spent executing <literal>BEFORE</literal> triggers, if any, is included in @@ -812,7 +812,7 @@ EXPLAIN UPDATE parent SET f2 = f2 + 1 WHERE f1 = 101; (either <literal>BEFORE</literal> or <literal>AFTER</literal>) is also shown separately. Note that deferred constraint triggers will not be executed until end of transaction and are thus not considered at all by - <command>EXPLAIN ANALYZE</command>. + <command>EXPLAIN EXEC</command>. </para> </sect2> @@ -822,11 +822,11 @@ EXPLAIN UPDATE parent SET f2 = f2 + 1 WHERE f1 = 101; <para> There are two significant ways in which run times measured by - <command>EXPLAIN ANALYZE</command> can deviate from normal execution of + <command>EXPLAIN EXEC</command> can deviate from normal execution of the same query. First, since no output rows are delivered to the client, network transmission costs and I/O conversion costs are not included. Second, the measurement overhead added by <command>EXPLAIN - ANALYZE</command> can be significant, especially on machines with slow + EXEC</command> can be significant, especially on machines with slow <function>gettimeofday()</function> operating-system calls. You can use the <xref linkend="pgtesttiming"/> tool to measure the overhead of timing on your system. @@ -853,7 +853,7 @@ EXPLAIN UPDATE parent SET f2 = f2 + 1 WHERE f1 = 101; effect. For example, in the <literal>LIMIT</literal> query we used before, <screen> -EXPLAIN ANALYZE SELECT * FROM tenk1 WHERE unique1 < 100 AND unique2 > 9000 LIMIT 2; +EXPLAIN EXEC SELECT * FROM tenk1 WHERE unique1 < 100 AND unique2 > 9000 LIMIT 2; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------- @@ -883,7 +883,7 @@ EXPLAIN ANALYZE SELECT * FROM tenk1 WHERE unique1 < 100 AND unique2 > 9000 of one child, with results like those mentioned for <literal>LIMIT</literal>. Also, if the outer (first) child contains rows with duplicate key values, the inner (second) child is backed up and rescanned for the portion of its - rows matching that key value. <command>EXPLAIN ANALYZE</command> counts these + rows matching that key value. <command>EXPLAIN EXEC</command> counts these repeated emissions of the same inner rows as if they were real additional rows. When there are many outer duplicates, the reported actual row count for the inner child plan node can be significantly larger than the number diff --git a/doc/src/sgml/planstats.sgml b/doc/src/sgml/planstats.sgml index 4b1d3f4952..3a4405c850 100644 --- a/doc/src/sgml/planstats.sgml +++ b/doc/src/sgml/planstats.sgml @@ -489,7 +489,7 @@ SELECT relpages, reltuples FROM pg_class WHERE relname = 't'; condition on the <structfield>a</structfield> column: <programlisting> -EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1; +EXPLAIN (EXEC, TIMING OFF) SELECT * FROM t WHERE a = 1; QUERY PLAN ------------------------------------------------------------------------------- Seq Scan on t (cost=0.00..170.00 rows=100 width=8) (actual rows=100 loops=1) @@ -506,7 +506,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1; condition on both columns, combining them with <literal>AND</literal>: <programlisting> -EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1; +EXPLAIN (EXEC, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1; QUERY PLAN ----------------------------------------------------------------------------- Seq Scan on t (cost=0.00..195.00 rows=1 width=8) (actual rows=100 loops=1) @@ -530,7 +530,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1; <programlisting> CREATE STATISTICS stts (dependencies) ON a, b FROM t; ANALYZE t; -EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1; +EXPLAIN (EXEC, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1; QUERY PLAN ------------------------------------------------------------------------------- Seq Scan on t (cost=0.00..195.00 rows=100 width=8) (actual rows=100 loops=1) @@ -551,7 +551,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1; estimated number of rows returned by the HashAggregate node) is very accurate: <programlisting> -EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a; +EXPLAIN (EXEC, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a; QUERY PLAN ----------------------------------------------------------------------------------------- HashAggregate (cost=195.00..196.00 rows=100 width=12) (actual rows=100 loops=1) @@ -562,7 +562,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a; groups in a query with two columns in <command>GROUP BY</command>, as in the following example, is off by an order of magnitude: <programlisting> -EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a, b; +EXPLAIN (EXEC, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a, b; QUERY PLAN -------------------------------------------------------------------------------------------- HashAggregate (cost=220.00..230.00 rows=1000 width=16) (actual rows=100 loops=1) @@ -575,7 +575,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a, b; DROP STATISTICS stts; CREATE STATISTICS stts (dependencies, ndistinct) ON a, b FROM t; ANALYZE t; -EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a, b; +EXPLAIN (EXEC, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a, b; QUERY PLAN -------------------------------------------------------------------------------------------- HashAggregate (cost=220.00..221.00 rows=100 width=16) (actual rows=100 loops=1) @@ -615,7 +615,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT COUNT(*) FROM t GROUP BY a, b; DROP STATISTICS stts; CREATE STATISTICS stts2 (mcv) ON a, b FROM t; ANALYZE t; -EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1; +EXPLAIN (EXEC, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 1; QUERY PLAN ------------------------------------------------------------------------------- Seq Scan on t (cost=0.00..195.00 rows=100 width=8) (actual rows=100 loops=1) @@ -672,7 +672,7 @@ SELECT m.* FROM pg_statistic_ext, to decide which combinations are compatible. <programlisting> -EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 10; +EXPLAIN (EXEC, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 10; QUERY PLAN --------------------------------------------------------------------------- Seq Scan on t (cost=0.00..195.00 rows=1 width=8) (actual rows=0 loops=1) @@ -685,7 +685,7 @@ EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a = 1 AND b = 10; example range query, presented earlier: <programlisting> -EXPLAIN (ANALYZE, TIMING OFF) SELECT * FROM t WHERE a <= 49 AND b > 49; +EXPLAIN (EXEC, TIMING OFF) SELECT * FROM t WHERE a <= 49 AND b > 49; QUERY PLAN --------------------------------------------------------------------------- Seq Scan on t (cost=0.00..195.00 rows=1 width=8) (actual rows=0 loops=1) diff --git a/doc/src/sgml/ref/create_statistics.sgml b/doc/src/sgml/ref/create_statistics.sgml index ae1d8024a4..18ca19fa8f 100644 --- a/doc/src/sgml/ref/create_statistics.sgml +++ b/doc/src/sgml/ref/create_statistics.sgml @@ -147,14 +147,14 @@ INSERT INTO t1 SELECT i/100, i/500 ANALYZE t1; -- the number of matching rows will be drastically underestimated: -EXPLAIN ANALYZE SELECT * FROM t1 WHERE (a = 1) AND (b = 0); +EXPLAIN EXEC SELECT * FROM t1 WHERE (a = 1) AND (b = 0); CREATE STATISTICS s1 (dependencies) ON a, b FROM t1; ANALYZE t1; -- now the row count estimate is more accurate: -EXPLAIN ANALYZE SELECT * FROM t1 WHERE (a = 1) AND (b = 0); +EXPLAIN EXEC SELECT * FROM t1 WHERE (a = 1) AND (b = 0); </programlisting> Without functional-dependency statistics, the planner would assume @@ -183,10 +183,10 @@ CREATE STATISTICS s2 (mcv) ON (a, b) FROM t2; ANALYZE t2; -- valid combination (found in MCV) -EXPLAIN ANALYZE SELECT * FROM t2 WHERE (a = 1) AND (b = 1); +EXPLAIN EXEC SELECT * FROM t2 WHERE (a = 1) AND (b = 1); -- invalid combination (not found in MCV) -EXPLAIN ANALYZE SELECT * FROM t2 WHERE (a = 1) AND (b = 2); +EXPLAIN EXEC SELECT * FROM t2 WHERE (a = 1) AND (b = 2); </programlisting> The MCV list gives the planner more detailed information about the diff --git a/doc/src/sgml/ref/pgtesttiming.sgml b/doc/src/sgml/ref/pgtesttiming.sgml index 545a934cf8..4470435dd2 100644 --- a/doc/src/sgml/ref/pgtesttiming.sgml +++ b/doc/src/sgml/ref/pgtesttiming.sgml @@ -30,7 +30,7 @@ <application>pg_test_timing</application> is a tool to measure the timing overhead on your system and confirm that the system time never moves backwards. Systems that are slow to collect timing data can give less accurate - <command>EXPLAIN ANALYZE</command> results. + <command>EXPLAIN EXEC</command> results. </para> </refsect1> @@ -120,7 +120,7 @@ Histogram of timing durations: <para> When the query executor is running a statement using - <command>EXPLAIN ANALYZE</command>, individual operations are timed as well + <command>EXPLAIN EXEC</command>, individual operations are timed as well as showing a summary. The overhead of your system can be checked by counting rows with the <application>psql</application> program: @@ -128,13 +128,13 @@ Histogram of timing durations: CREATE TABLE t AS SELECT * FROM generate_series(1,100000); \timing SELECT COUNT(*) FROM t; -EXPLAIN ANALYZE SELECT COUNT(*) FROM t; +EXPLAIN EXEC SELECT COUNT(*) FROM t; </screen> </para> <para> The i7-860 system measured runs the count query in 9.8 ms while - the <command>EXPLAIN ANALYZE</command> version takes 16.6 ms, each + the <command>EXPLAIN EXEC</command> version takes 16.6 ms, each processing just over 100,000 rows. That 6.8 ms difference means the timing overhead per row is 68 ns, about twice what pg_test_timing estimated it would be. Even that relatively small amount of overhead is making the fully @@ -169,12 +169,12 @@ Histogram of timing durations: </para> <para> - In this configuration, the sample <command>EXPLAIN ANALYZE</command> above + In this configuration, the sample <command>EXPLAIN EXEC</command> above takes 115.9 ms. That's 1061 ns of timing overhead, again a small multiple of what's measured directly by this utility. That much timing overhead means the actual query itself is only taking a tiny fraction of the accounted for time, most of it is being consumed in overhead instead. In - this configuration, any <command>EXPLAIN ANALYZE</command> totals involving + this configuration, any <command>EXPLAIN EXEC</command> totals involving many timed operations would be inflated significantly by timing overhead. </para> diff --git a/doc/src/sgml/ref/set_transaction.sgml b/doc/src/sgml/ref/set_transaction.sgml index 43b1c6c892..cef790ecd7 100644 --- a/doc/src/sgml/ref/set_transaction.sgml +++ b/doc/src/sgml/ref/set_transaction.sgml @@ -133,7 +133,7 @@ SET SESSION CHARACTERISTICS AS TRANSACTION <replaceable class="parameter">transa <literal>CREATE</literal>, <literal>ALTER</literal>, and <literal>DROP</literal> commands; <literal>COMMENT</literal>, <literal>GRANT</literal>, <literal>REVOKE</literal>, - <literal>TRUNCATE</literal>; and <literal>EXPLAIN ANALYZE</literal> + <literal>TRUNCATE</literal>; and <literal>EXPLAIN EXEC</literal> and <literal>EXECUTE</literal> if the command they would execute is among those listed. This is a high-level notion of read-only that does not prevent all writes to disk. diff --git a/doc/src/sgml/rules.sgml b/doc/src/sgml/rules.sgml index 4e20664ea1..499e6fcced 100644 --- a/doc/src/sgml/rules.sgml +++ b/doc/src/sgml/rules.sgml @@ -1030,7 +1030,7 @@ SELECT count(*) FROM words WHERE word = 'caterpiler'; (1 row) </programlisting> - With <command>EXPLAIN ANALYZE</command>, we see: + With <command>EXPLAIN EXEC</command>, we see: <programlisting> Aggregate (cost=21763.99..21764.00 rows=1 width=0) (actual time=188.180..188.181 rows=1 loops=1) ^ permalink raw reply [nested|flat] 21+ messages in thread
* Re: GUC names in messages @ 2023-11-08 22:53 Peter Smith <[email protected]> 0 siblings, 1 reply; 21+ messages in thread From: Peter Smith @ 2023-11-08 22:53 UTC (permalink / raw) To: Nathan Bossart <[email protected]>; +Cc: Alvaro Herrera <[email protected]>; Laurenz Albe <[email protected]>; Peter Eisentraut <[email protected]>; Tom Lane <[email protected]>; Daniel Gustafsson <[email protected]>; PostgreSQL Hackers <[email protected]> On Wed, Nov 8, 2023 at 7:40 AM Peter Smith <[email protected]> wrote: > > FWIW, I am halfway through doing regex checking of the PG16 source for > all GUC names in messages to see what current styles are in use today. > > Not sure if those numbers will influence the decision. > > I hope I can post my findings today or tomorrow. > Here are my findings from the current PG16 source messages. I used a regex search: ".*GUCNAME to find how each GUCNAME is used in the messages in *.c files. The GUC names are taken from the guc_tables.c code, so they are grouped accordingly below. ~TOTALS: messages where GUC names are QUOTED: - bool = 11 - int = 11 - real = 0 - string = 10 - enum = 7 TOTAL = 39 messages where GUC names are NOT QUOTED: - bool = 14 - int = 60 - real = 0 - string = 59 - enum = 31 TOTAL = 164 ~~~ Details are in the attached file. PSA. I've categorised them as being currently QUOTED, NOT QUOTED, and NONE (most are not used in any messages). Notice that NOT QUOTED is the far more common pattern, so my vote would be just to standardise on making everything this way. I know there was some concern raised about ambiguous words like "timezone" and "datestyle" etc but in practice, those are rare. Also, those GUCs are different in that they are written as camel-case (e.g. "DateStyle") in the guc_tables.c, so if they were also written camel-case in the messages that could remove ambiguities with normal words. YMMV. Anyway, I will await a verdict about what to do. ====== Kind Regards, Peter Smith. Fujitsu Australia Hi I used regex search: ".*GUCNAME to find how each GUCNAME is used in messages in *.c files. GUC names are taken from the guc_tables.c code, so are grouped accordingly below. I've categorised them as being currently QUOTED, NOT QUOTED, and NONE (many are not used in any messages). ~TOTALS: messages where GUC names are quoted: - bool = 11 - int = 11 - real = 0 - string = 10 - enum = 7 - TOTAL = 39 messages where GUC names are NOT quoted: - bool = 14 - int = 60 - real = 0 - string = 59 - enum = 31 - TOTAL = 164 Details below... /////////////////////////// ------------------ ConfigureNamesBool ------------------ {"enable_seqscan", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_indexscan", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_indexonlyscan", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_bitmapscan", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_tidscan", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_sort", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_incremental_sort", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_hashagg", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_material", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_memoize", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_nestloop", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_mergejoin", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_hashjoin", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_gathermerge", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_partitionwise_join", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_partitionwise_aggregate", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_parallel_append", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_parallel_hash", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_partition_pruning", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_presorted_aggregate", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_async_append", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"geqo", PGC_USERSET, QUERY_TUNING_GEQO, - NONE {"is_superuser", PGC_INTERNAL, UNGROUPED, - NONE {"bonjour", PGC_POSTMASTER, CONN_AUTH_SETTINGS, - NONE {"track_commit_timestamp", PGC_POSTMASTER, REPLICATION_SENDING, - QUOTED errhint("Make sure the configuration parameter \"%s\" is set on the primary server.", "track_commit_timestamp") : errhint("Make sure the configuration parameter \"%s\" is set.", "track_commit_timestamp"))); {"ssl", PGC_SIGHUP, CONN_AUTH_SSL, - NOT QUOTED errhint("Set ssl = on in postgresql.conf."), {"ssl_passphrase_command_supports_reload", PGC_SIGHUP, CONN_AUTH_SSL, - NONE {"ssl_prefer_server_ciphers", PGC_SIGHUP, CONN_AUTH_SSL, - NONE {"fsync", PGC_SIGHUP, WAL_SETTINGS, - NONE {"zero_damaged_pages", PGC_SUSET, DEVELOPER_OPTIONS, - NOT QUOTED gettext_noop(... Setting " "zero_damaged_pages to true causes the system to instead report a "... {"ignore_invalid_pages", PGC_POSTMASTER, DEVELOPER_OPTIONS, - NOT QUOTED gettext_noop(... "Setting ignore_invalid_pages to true causes " {"full_page_writes", PGC_SIGHUP, WAL_SETTINGS, - NOT QUOTED errmsg("WAL generated with full_page_writes=off was replayed ""since last restartpoint"), errhint(... "Enable full_page_writes and run CHECKPOINT on the primary, ""and then try an online backup again."))); errmsg("WAL generated with full_page_writes=off was replayed ""during online backup"),\ errhint(... "Enable full_page_writes and run CHECKPOINT on the primary, " "and then try an online backup again."))); pg_fatal("full_page_writes must be enabled in the source server"); {"wal_log_hints", PGC_POSTMASTER, WAL_SETTINGS, - QUOTED, but this quotes everything -- not just the GUC name "target server needs to use either data checksums or \"wal_log_hints = on\""); {"wal_init_zero", PGC_SUSET, WAL_SETTINGS, - NONE {"wal_recycle", PGC_SUSET, WAL_SETTINGS, - NONE {"log_checkpoints", PGC_SIGHUP, LOGGING_WHAT, - NONE {"log_connections", PGC_SU_BACKEND, LOGGING_WHAT, - NONE {"log_disconnections", PGC_SU_BACKEND, LOGGING_WHAT, - NONE {"log_replication_commands", PGC_SUSET, LOGGING_WHAT, - NONE {"debug_assertions", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"exit_on_error", PGC_USERSET, ERROR_HANDLING_OPTIONS, - NONE {"restart_after_crash", PGC_SIGHUP, ERROR_HANDLING_OPTIONS, - NOT QUOTED (errmsg("shutting down because restart_after_crash is off"))); {"remove_temp_files_after_crash", PGC_SIGHUP, DEVELOPER_OPTIONS, - NONE {"send_abort_for_crash", PGC_SIGHUP, DEVELOPER_OPTIONS, - NONE {"send_abort_for_kill", PGC_SIGHUP, DEVELOPER_OPTIONS, - NONE {"log_duration", PGC_SUSET, LOGGING_WHAT, - NONE {"debug_print_parse", PGC_USERSET, LOGGING_WHAT, - NONE {"debug_print_rewritten", PGC_USERSET, LOGGING_WHAT, - NONE {"debug_print_plan", PGC_USERSET, LOGGING_WHAT, - NONE {"debug_pretty_print", PGC_USERSET, LOGGING_WHAT, - NONE {"log_parser_stats", PGC_SUSET, STATS_MONITORING, - QUOTED GUC_check_errdetail("Cannot enable \"log_statement_stats\" when ""\"log_parser_stats\", \"log_planner_stats\", ""or \"log_executor_stats\" is true."); {"log_planner_stats", PGC_SUSET, STATS_MONITORING, - QUOTED GUC_check_errdetail("Cannot enable \"log_statement_stats\" when ""\"log_parser_stats\", \"log_planner_stats\", ""or \"log_executor_stats\" is true."); {"log_executor_stats", PGC_SUSET, STATS_MONITORING, - QUOTED GUC_check_errdetail("Cannot enable \"log_statement_stats\" when ""\"log_parser_stats\", \"log_planner_stats\", ""or \"log_executor_stats\" is true.") {"log_statement_stats", PGC_SUSET, STATS_MONITORING, - QUOTED GUC_check_errdetail("Cannot enable parameter when \"log_statement_stats\" is true."); GUC_check_errdetail("Cannot enable \"log_statement_stats\" when ""\"log_parser_stats\", \"log_planner_stats\", ""or \"log_executor_stats\" is true."); {"log_btree_build_stats", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"track_activities", PGC_SUSET, STATS_CUMULATIVE, - NONE {"track_counts", PGC_SUSET, STATS_CUMULATIVE, - NONE {"track_io_timing", PGC_SUSET, STATS_CUMULATIVE, - NONE {"track_wal_io_timing", PGC_SUSET, STATS_CUMULATIVE, - NONE {"update_process_title", PGC_SUSET, PROCESS_TITLE, - NONE {"autovacuum", PGC_SIGHUP, AUTOVACUUM, - NONE {"trace_notify", PGC_USERSET, DEVELOPER_OPTIONS, - NONE {"trace_locks", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"trace_userlocks", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"trace_lwlocks", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"debug_deadlocks", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"log_lock_waits", PGC_SUSET, LOGGING_WHAT, - NONE {"log_recovery_conflict_waits", PGC_SIGHUP, LOGGING_WHAT, - NONE {"log_hostname", PGC_SIGHUP, LOGGING_WHAT, - NONE {"transform_null_equals", PGC_USERSET, COMPAT_OPTIONS_CLIENT, - NONE {"db_user_namespace", PGC_SIGHUP, CONN_AUTH_AUTH, - QUOTED errmsg("MD5 authentication is not supported when \"db_user_namespace\" is enabled"))) errmsg("MD5 authentication is not supported when \"db_user_namespace\" is enabled"), *err_msg = "MD5 authentication is not supported when \"db_user_namespace\" is enabled"; {"default_transaction_read_only", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"transaction_read_only", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"default_transaction_deferrable", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"transaction_deferrable", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"row_security", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"check_function_bodies", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"array_nulls", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS, - NONE {"default_with_oids", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS, - NONE {"logging_collector", PGC_POSTMASTER, LOGGING_WHERE, - NONE {"log_truncate_on_rotation", PGC_SIGHUP, LOGGING_WHERE, - NONE {"trace_sort", PGC_USERSET, DEVELOPER_OPTIONS, - NONE {"trace_syncscan", PGC_USERSET, DEVELOPER_OPTIONS, - NONE "optimize_bounded_sort", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"wal_debug", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"integer_datetimes", PGC_INTERNAL, PRESET_OPTIONS, - NOT QUOTED pg_log_error("could not determine server setting for integer_datetimes"); pg_log_error("integer_datetimes compile flag does not match server"); {"krb_caseins_users", PGC_SIGHUP, CONN_AUTH_AUTH, - NONE {"gss_accept_delegation", PGC_SIGHUP, CONN_AUTH_AUTH, - NONE {"escape_string_warning", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS, - NONE {"standard_conforming_strings", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS, - NOT QUOTED errdetail("String constants with Unicode escapes cannot be used when standard_conforming_strings is off."), pg_log_info("saving standard_conforming_strings = %s", stdstrings); {"synchronize_seqscans", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS, - NONE {"recovery_target_inclusive", PGC_POSTMASTER, WAL_RECOVERY_TARGET, - NONE {"hot_standby", PGC_POSTMASTER, REPLICATION_STANDBY, - NONE {"hot_standby_feedback", PGC_SIGHUP, REPLICATION_STANDBY, - NONE {"in_hot_standby", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"allow_system_table_mods", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"ignore_system_indexes", PGC_BACKEND, DEVELOPER_OPTIONS, - NONE {"allow_in_place_tablespaces", PGC_SUSET, DEVELOPER_OPTIONS, - NOT QUOTED errhint("Remove those directories, or set allow_in_place_tablespaces to ON transiently to let recovery complete."))); {"lo_compat_privileges", PGC_SUSET, COMPAT_OPTIONS_PREVIOUS, - NONE {"quote_all_identifiers", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS, - NONE {"data_checksums", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"syslog_sequence_numbers", PGC_SIGHUP, LOGGING_WHERE, - NONE {"syslog_split_messages", PGC_SIGHUP, LOGGING_WHERE, - NONE {"parallel_leader_participation", PGC_USERSET, RESOURCES_ASYNCHRONOUS, - NONE {"jit", PGC_USERSET, QUERY_TUNING_OTHER, - NONE {"jit_debugging_support", PGC_SU_BACKEND, DEVELOPER_OPTIONS, - NONE {"jit_dump_bitcode", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"jit_expressions", PGC_USERSET, DEVELOPER_OPTIONS, - NONE {"jit_profiling_support", PGC_SU_BACKEND, DEVELOPER_OPTIONS, - NONE {"jit_tuple_deforming", PGC_USERSET, DEVELOPER_OPTIONS, - NONE {"data_sync_retry", PGC_POSTMASTER, ERROR_HANDLING_OPTIONS, - NONE {"wal_receiver_create_temp_slot", PGC_SIGHUP, REPLICATION_STANDBY, - NONE ~~~ ----------------- ConfigureNamesInt ----------------- {"archive_timeout", PGC_SIGHUP, WAL_ARCHIVING, - NOT QUOTED elog(DEBUG1, "write-ahead log switch forced (archive_timeout=%d)", XLogArchiveTimeout); {"post_auth_delay", PGC_BACKEND, DEVELOPER_OPTIONS, - NONE {"default_statistics_target", PGC_USERSET, QUERY_TUNING_OTHER, - NONE {"from_collapse_limit", PGC_USERSET, QUERY_TUNING_OTHER, - NONE {"join_collapse_limit", PGC_USERSET, QUERY_TUNING_OTHER, - NONE {"geqo_threshold", PGC_USERSET, QUERY_TUNING_GEQO, - NONE {"geqo_effort", PGC_USERSET, QUERY_TUNING_GEQO, - NONE {"geqo_pool_size", PGC_USERSET, QUERY_TUNING_GEQO, - NONE {"geqo_generations", PGC_USERSET, QUERY_TUNING_GEQO, - NONE {"deadlock_timeout", PGC_SUSET, LOCK_MANAGEMENT, - NONE {"max_standby_archive_delay", PGC_SIGHUP, REPLICATION_STANDBY, - NONE {"max_standby_streaming_delay", PGC_SIGHUP, REPLICATION_STANDBY, - NONE {"recovery_min_apply_delay", PGC_SIGHUP, REPLICATION_STANDBY, - NONE {"wal_receiver_status_interval", PGC_SIGHUP, REPLICATION_STANDBY, - NONE {"wal_receiver_timeout", PGC_SIGHUP, REPLICATION_STANDBY, - NONE {"max_connections", PGC_POSTMASTER, CONN_AUTH_SETTINGS, - NOT QUOTED errhint(...consumption of semaphores by reducing its max_connections parameter.\n" "The PostgreSQL documentation contains more information about "... errhint("This error usually means that PostgreSQL's request ... perhaps by reducing shared_buffers or ""max_connections.", write_stderr("%s: superuser_reserved_connections (%d) plus reserved_connections (%d) must be less than max_connections (%d)\n", errhint("You might need to run fewer transactions at a time or increase max_connections."))); errhint("You might need to run fewer transactions at a time or increase max_connections."))); printf(_("selecting default max_connections ... ")); {"superuser_reserved_connections", PGC_POSTMASTER, CONN_AUTH_SETTINGS, - NOT QUOTED write_stderr("%s: superuser_reserved_connections (%d) plus reserved_connections (%d) must be less than max_connections (%d)\n", {"reserved_connections", PGC_POSTMASTER, CONN_AUTH_SETTINGS, - NOT QUOTED write_stderr("%s: superuser_reserved_connections (%d) plus reserved_connections (%d) must be less than max_connections (%d)\n", {"min_dynamic_shared_memory", PGC_POSTMASTER, RESOURCES_MEM, - NONE {"shared_buffers", PGC_POSTMASTER, RESOURCES_MEM, - NOT QUOTED errhint("This error usually means that PostgreSQL's request "..."memory usage, perhaps by reducing shared_buffers or ""max_connections.", printf(_("selecting default shared_buffers ... ")); {"vacuum_buffer_usage_limit", PGC_USERSET, RESOURCES_MEM, - QUOTED GUC_check_errdetail("\"vacuum_buffer_usage_limit\" must be 0 or between %d kB and %d kB",MIN_BAS_VAC_RING_SIZE_KB, MAX_BAS_VAC_RING_SIZE_KB); {"shared_memory_size", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"shared_memory_size_in_huge_pages", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"temp_buffers", PGC_USERSET, RESOURCES_MEM, - QUOTED GUC_check_errdetail("\"temp_buffers\" cannot be changed after any temporary tables have been accessed in the session."); {"port", PGC_POSTMASTER, CONN_AUTH_SETTINGS, - NONE? {"unix_socket_permissions", PGC_POSTMASTER, CONN_AUTH_SETTINGS, - NONE {"log_file_mode", PGC_SIGHUP, LOGGING_WHERE, - NONE {"data_directory_mode", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"work_mem", PGC_USERSET, RESOURCES_MEM, - NOT QUOTED gettext_noop("Multiple of work_mem to use for hash tables."), {"maintenance_work_mem", PGC_USERSET, RESOURCES_MEM, - NOT QUOTED errhint("Reduce maintenance_work_mem."))); - QUOTED errhint("Consider increasing configuration parameter \"maintenance_work_mem\" or \"autovacuum_work_mem\".\n" {"logical_decoding_work_mem", PGC_USERSET, RESOURCES_MEM, - NONE {"max_stack_depth", PGC_SUSET, RESOURCES_MEM, - QUOTED errhint("Increase the configuration parameter \"max_stack_depth\" (currently %dkB), ""after ensuring the platform's stack depth limit is adequate.", GUC_check_errdetail("\"max_stack_depth\" must not exceed %ldkB.",(stack_rlimit - STACK_DEPTH_SLOP) / 1024L); {"temp_file_limit", PGC_SUSET, RESOURCES_DISK, - NONE {"vacuum_cost_page_hit", PGC_USERSET, RESOURCES_VACUUM_DELAY, - NONE {"vacuum_cost_page_miss", PGC_USERSET, RESOURCES_VACUUM_DELAY, - NONE {"vacuum_cost_page_dirty", PGC_USERSET, RESOURCES_VACUUM_DELAY, - NONE {"vacuum_cost_limit", PGC_USERSET, RESOURCES_VACUUM_DELAY, - NONE {"autovacuum_vacuum_cost_limit", PGC_SIGHUP, AUTOVACUUM, - NONE {"max_files_per_process", PGC_POSTMASTER, RESOURCES_KERNEL, - NONE {"max_prepared_transactions", PGC_POSTMASTER, RESOURCES_MEM, - NOT QUOTED errhint("Set max_prepared_transactions to a nonzero value."))); errhint("Increase max_prepared_transactions (currently %d).", max_prepared_xacts))); errhint("Increase max_prepared_transactions (currently %d).", max_prepared_xacts))); {"trace_lock_oidmin", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"trace_lock_table", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"statement_timeout", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"lock_timeout", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"idle_in_transaction_session_timeout", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"idle_session_timeout", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"vacuum_freeze_min_age", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"vacuum_freeze_table_age", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"vacuum_multixact_freeze_min_age", PGC_USERSET, CLIENT_CONN_STATEMENT, - NOT QUOTED errhint("Execute a database-wide VACUUM in database with OID %u with reduced vacuum_multixact_freeze_min_age and... errhint("Execute a database-wide VACUUM in that database with reduced vacuum_multixact_freeze_min_age and... {"vacuum_multixact_freeze_table_age", PGC_USERSET, CLIENT_CONN_STATEMENT, - NOT QUOTED errhint(... with OID %u with reduced vacuum_multixact_freeze_min_age and vacuum_multixact_freeze_table_age settings.", errhint(... with reduced vacuum_multixact_freeze_min_age and vacuum_multixact_freeze_table_age settings."))); {"vacuum_failsafe_age", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"vacuum_multixact_failsafe_age", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"max_locks_per_transaction", PGC_POSTMASTER, LOCK_MANAGEMENT, - NOT QUOTED errhint("You might need to increase %s.", "max_locks_per_transaction"))); errhint("You might need to increase %s.", "max_locks_per_transaction"))); errhint("You might need to increase %s.", "max_locks_per_transaction"))); errhint("You might need to increase %s.", "max_locks_per_transaction"))); errhint("You might need to increase %s.", "max_locks_per_transaction"))); errhint("You might need to increase %s.", "max_locks_per_transaction"))); gettext_noop(... "max_locks_per_transaction objects per server process or prepared "...) {"max_pred_locks_per_transaction", PGC_POSTMASTER, LOCK_MANAGEMENT, - NOT QUOTED errhint("You might need to increase %s.", "max_pred_locks_per_transaction"))); errhint("You might need to increase %s.", "max_pred_locks_per_transaction"))); errhint("You might need to increase %s.", "max_pred_locks_per_transaction"))); gettext_noop(..."at most max_pred_locks_per_transaction objects per server process "...) {"max_pred_locks_per_relation", PGC_SIGHUP, LOCK_MANAGEMENT, - NONE {"max_pred_locks_per_page", PGC_SIGHUP, LOCK_MANAGEMENT, - NONE {"authentication_timeout", PGC_SIGHUP, CONN_AUTH_AUTH, - NONE {"pre_auth_delay", PGC_SIGHUP, DEVELOPER_OPTIONS, - NONE {"wal_decode_buffer_size", PGC_POSTMASTER, WAL_RECOVERY, - NONE {"wal_keep_size", PGC_SIGHUP, REPLICATION_SENDING, - NONE {"min_wal_size", PGC_SIGHUP, WAL_CHECKPOINTS, - QUOTED errmsg("\"min_wal_size\" must be at least twice \"wal_segment_size\""))); {"max_wal_size", PGC_SIGHUP, WAL_CHECKPOINTS, - QUOTED errmsg("\"max_wal_size\" must be at least twice \"wal_segment_size\""))); errhint("Consider increasing the configuration parameter \"max_wal_size\"."))); {"checkpoint_timeout", PGC_SIGHUP, WAL_CHECKPOINTS, - NONE {"checkpoint_warning", PGC_SIGHUP, WAL_CHECKPOINTS, - NONE {"checkpoint_flush_after", PGC_SIGHUP, WAL_CHECKPOINTS, - NONE {"wal_buffers", PGC_POSTMASTER, WAL_SETTINGS, - NONE {"wal_writer_delay", PGC_SIGHUP, WAL_SETTINGS, - NONE {"wal_writer_flush_after", PGC_SIGHUP, WAL_SETTINGS, - NONE {"wal_skip_threshold", PGC_USERSET, WAL_SETTINGS, - NONE {"max_wal_senders", PGC_POSTMASTER, REPLICATION_SENDING, - NOT QUOTED (errmsg("WAL streaming (max_wal_senders > 0) requires wal_level \"replica\" or \"logical\""))); errmsg("number of requested standby connections exceeds max_wal_senders (currently %d)", max_wal_senders))); {"max_replication_slots", PGC_POSTMASTER, REPLICATION_SENDING, - NOT QUOTED errhint("Free one or increase max_replication_slots."))); errmsg("replication slots can only be used if max_replication_slots > 0"))); errhint("Increase max_replication_slots and try again."))); errmsg("cannot start logical replication workers when max_replication_slots = 0"))); errmsg("cannot query or manipulate replication origin when max_replication_slots = 0"))); errmsg("could not find free replication state, increase max_replication_slots"))); errhint("Increase max_replication_slots and try again."))); errhint("Increase max_replication_slots and try again."))); {"max_slot_wal_keep_size", PGC_SIGHUP, REPLICATION_SENDING, - NOT QUOTED hint ? errhint("You might need to increase %s.", "max_slot_wal_keep_size") : 0); {"wal_sender_timeout", PGC_USERSET, REPLICATION_SENDING, - NONE {"commit_delay", PGC_SUSET, WAL_SETTINGS, - NOT QUOTED gettext_noop("Sets the minimum number of concurrent open transactions ""required before performing commit_delay.") {"commit_siblings", PGC_USERSET, WAL_SETTINGS, - NONE {"extra_float_digits", PGC_USERSET, CLIENT_CONN_LOCALE, - NONE {"log_min_duration_sample", PGC_SUSET, LOGGING_WHEN, - NOT QUOTED gettext_noop("Fraction of statements exceeding log_min_duration_sample to be logged."), {"log_min_duration_statement", PGC_SUSET, LOGGING_WHEN, - NONE {"log_autovacuum_min_duration", PGC_SIGHUP, LOGGING_WHAT, - NONE {"log_parameter_max_length", PGC_SUSET, LOGGING_WHAT, - NONE {"log_parameter_max_length_on_error", PGC_USERSET, LOGGING_WHAT, - NONE {"bgwriter_delay", PGC_SIGHUP, RESOURCES_BGWRITER, - NONE {"bgwriter_lru_maxpages", PGC_SIGHUP, RESOURCES_BGWRITER, - NONE {"bgwriter_flush_after", PGC_SIGHUP, RESOURCES_BGWRITER, - NONE {"effective_io_concurrency", - NOT QUOTED GUC_check_errdetail("effective_io_concurrency must be set to 0 on platforms that lack posix_fadvise()."); gettext_noop("A variant of effective_io_concurrency that is used for maintenance work."), {"maintenance_io_concurrency", - NOT QUOTED GUC_check_errdetail("maintenance_io_concurrency must be set to 0 on platforms that lack posix_fadvise()."); {"backend_flush_after", PGC_USERSET, RESOURCES_ASYNCHRONOUS, - NONE {"max_worker_processes", - NOT QUOTED, but note probably some of these should be making use of common style "You may need to increase %s." errhint("You may need to increase max_worker_processes."))); errhint("Consider increasing configuration parameter \"max_worker_processes\"."))); (errmsg("inconsistent background worker state (max_worker_processes=%d, total_slots=%d)",...))); errhint("Consider increasing the configuration parameter \"max_worker_processes\"."))); errhint("You might need to increase %s.", "max_worker_processes"))); errhint("You may need to increase max_worker_processes."))); {"max_logical_replication_workers", - NOT QUOTED errhint("You might need to increase %s.", "max_logical_replication_workers"))); {"max_sync_workers_per_subscription", - NONE {"max_parallel_apply_workers_per_subscription", - NONE {"log_rotation_age", PGC_SIGHUP, LOGGING_WHERE, - NONE {"log_rotation_size", PGC_SIGHUP, LOGGING_WHERE, - NONE {"max_function_args", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"max_index_keys", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"max_identifier_length", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"block_size", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"segment_size", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"wal_block_size", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"wal_retrieve_retry_interval", PGC_SIGHUP, REPLICATION_STANDBY, - NONE {"wal_segment_size", PGC_INTERNAL, PRESET_OPTIONS, - QUOTED errmsg("\"min_wal_size\" must be at least twice \"wal_segment_size\""))); errmsg("\"max_wal_size\" must be at least twice \"wal_segment_size\""))); {"autovacuum_naptime", PGC_SIGHUP, AUTOVACUUM, - NONE {"autovacuum_vacuum_threshold", PGC_SIGHUP, AUTOVACUUM, - NONE {"autovacuum_vacuum_insert_threshold", PGC_SIGHUP, AUTOVACUUM, - NONE {"autovacuum_analyze_threshold", PGC_SIGHUP, AUTOVACUUM, - NONE {"autovacuum_freeze_max_age", PGC_POSTMASTER, AUTOVACUUM, - NONE {"autovacuum_multixact_freeze_max_age", PGC_POSTMASTER, AUTOVACUUM, - NONE {"autovacuum_max_workers", PGC_POSTMASTER, AUTOVACUUM, - NONE {"max_parallel_maintenance_workers", PGC_USERSET, RESOURCES_ASYNCHRONOUS, - NONE {"max_parallel_workers_per_gather", PGC_USERSET, RESOURCES_ASYNCHRONOUS, - NONE {"max_parallel_workers", PGC_USERSET, RESOURCES_ASYNCHRONOUS, - NONE {"autovacuum_work_mem", PGC_SIGHUP, RESOURCES_MEM, - QUOTED errhint("Consider increasing configuration parameter \"maintenance_work_mem\" or \"autovacuum_work_mem\".\n"...))); {"old_snapshot_threshold", PGC_POSTMASTER, RESOURCES_ASYNCHRONOUS, - NONE {"tcp_keepalives_idle", PGC_USERSET, CONN_AUTH_TCP, - NONE {"tcp_keepalives_interval", PGC_USERSET, CONN_AUTH_TCP, - NONE {"ssl_renegotiation_limit", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS, - NONE {"tcp_keepalives_count", PGC_USERSET, CONN_AUTH_TCP, - NONE {"gin_fuzzy_search_limit", PGC_USERSET, CLIENT_CONN_OTHER, - NONE {"effective_cache_size", PGC_USERSET, QUERY_TUNING_COST, - NONE {"min_parallel_table_scan_size", PGC_USERSET, QUERY_TUNING_COST, - NONE {"min_parallel_index_scan_size", PGC_USERSET, QUERY_TUNING_COST, - NONE {"server_version_num", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"log_temp_files", PGC_SUSET, LOGGING_WHAT, - NONE {"gin_pending_list_limit", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"tcp_user_timeout", PGC_USERSET, CONN_AUTH_TCP, - NOT QUOTED, althought I am not sure if this really is the GUC (errmsg("%s(%s) failed: %m", "getsockopt", "TCP_USER_TIMEOUT"))); (errmsg("%s(%s) failed: %m", "setsockopt", "TCP_USER_TIMEOUT"))); (errmsg("%s(%s) not supported", "setsockopt", "TCP_USER_TIMEOUT"))); {"huge_page_size", PGC_POSTMASTER, RESOURCES_MEM, - NOT QUOTED GUC_check_errdetail("huge_page_size must be 0 on this platform."); GUC_check_errdetail("huge_page_size must be 0 on this platform."); {"debug_discard_caches", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"client_connection_check_interval", PGC_USERSET, CONN_AUTH_TCP, - NOT QUOTED GUC_check_errdetail("client_connection_check_interval must be set to 0 on this platform."); {"log_startup_progress_interval", PGC_SIGHUP, LOGGING_WHEN, - NONE {"scram_iterations", PGC_USERSET, CONN_AUTH_AUTH, - NONE ~~~ ------------------ ConfigureNamesReal ------------------ {"seq_page_cost", PGC_USERSET, QUERY_TUNING_COST, - NONE {"random_page_cost", PGC_USERSET, QUERY_TUNING_COST, - NONE {"cpu_tuple_cost", PGC_USERSET, QUERY_TUNING_COST, - NONE {"cpu_index_tuple_cost", PGC_USERSET, QUERY_TUNING_COST, - NONE {"cpu_operator_cost", PGC_USERSET, QUERY_TUNING_COST, - NONE {"parallel_tuple_cost", PGC_USERSET, QUERY_TUNING_COST, - NONE {"parallel_setup_cost", PGC_USERSET, QUERY_TUNING_COST, - NONE {"jit_above_cost", PGC_USERSET, QUERY_TUNING_COST, - NONE {"jit_optimize_above_cost", PGC_USERSET, QUERY_TUNING_COST, - NONE {"jit_inline_above_cost", PGC_USERSET, QUERY_TUNING_COST, - NONE {"cursor_tuple_fraction", PGC_USERSET, QUERY_TUNING_OTHER, - NONE {"recursive_worktable_factor", PGC_USERSET, QUERY_TUNING_OTHER, - NONE {"geqo_selection_bias", PGC_USERSET, QUERY_TUNING_GEQO, - NONE {"geqo_seed", PGC_USERSET, QUERY_TUNING_GEQO, - NONE {"hash_mem_multiplier", PGC_USERSET, RESOURCES_MEM, - NONE {"bgwriter_lru_multiplier", PGC_SIGHUP, RESOURCES_BGWRITER, - NONE {"seed", PGC_USERSET, UNGROUPED, - NONE? {"vacuum_cost_delay", PGC_USERSET, RESOURCES_VACUUM_DELAY, - NONE {"autovacuum_vacuum_cost_delay", PGC_SIGHUP, AUTOVACUUM, - NONE {"autovacuum_vacuum_scale_factor", PGC_SIGHUP, AUTOVACUUM, - NONE {"autovacuum_vacuum_insert_scale_factor", PGC_SIGHUP, AUTOVACUUM, - NONE {"autovacuum_analyze_scale_factor", PGC_SIGHUP, AUTOVACUUM, - NONE {"checkpoint_completion_target", PGC_SIGHUP, WAL_CHECKPOINTS, - NONE {"log_statement_sample_rate", PGC_SUSET, LOGGING_WHEN, - NONE {"log_transaction_sample_rate", PGC_SUSET, LOGGING_WHEN, - NONE ~~~ -------------------- ConfigureNamesString -------------------- {"archive_command", PGC_SIGHUP, WAL_ARCHIVING, - NOT QUOTED errhint("Check that your archive_command is executing properly. " errmsg("both archive_command and archive_library set"), errdetail("Only one of archive_command, archive_library may be set."))); errmsg("both archive_command and archive_library set"), errdetail("Only one of archive_command, archive_library may be set."))); gettext_noop("Allows archiving of WAL files using archive_command."), - QUOTED gettext_noop("An empty string indicates that \"archive_command\" should be used.") {"archive_library", PGC_SIGHUP, WAL_ARCHIVING, - NOT QUOTED errmsg("both archive_command and archive_library set"), errdetail("Only one of archive_command, archive_library may be set."))); errmsg("both archive_command and archive_library set"), errdetail("Only one of archive_command, archive_library may be set."))) - QUOTED (errmsg("restarting archiver process because value of " "\"archive_library\" was changed"))); gettext_noop("This is used only if \"archive_library\" is not set.") {"restore_command", PGC_SIGHUP, WAL_ARCHIVE_RECOVERY, - NOT QUOTED errdetail("restore_command returned a zero exit status, but stat() failed."))); (errmsg("specified neither primary_conninfo nor restore_command"), errmsg("must specify restore_command when standby mode is not enabled"))); pg_fatal("restore_command is not set in the target cluster"); pg_log_debug("using for rewind restore_command = \'%s\'", pg_fatal("restore_command failed: %s", wait_result_to_str(rc)); {"archive_cleanup_command", PGC_SIGHUP, WAL_ARCHIVE_RECOVERY, - NONE {"recovery_end_command", PGC_SIGHUP, WAL_ARCHIVE_RECOVERY, - NOT QUOTED (errmsg("%s \"%s\": %s", commandName, command, wait_result_to_str(rc)))); {"recovery_target_timeline", PGC_POSTMASTER, WAL_RECOVERY_TARGET, - NOT QUOTED GUC_check_errdetail("recovery_target_timeline is not a valid number."); {"recovery_target", PGC_POSTMASTER, WAL_RECOVERY_TARGET, - NOT QUOTED errdetail("At most one of recovery_target, recovery_target_lsn, recovery_target_name, recovery_target_time, recovery_target_xid may be set."))); GUC_check_errdetail("%s is too long (maximum %d characters).", "recovery_target_name", MAXFNAMELEN - 1) GUC_check_errdetail("recovery_target_timeline is not a valid number."); {"recovery_target_xid", PGC_POSTMASTER, WAL_RECOVERY_TARGET, - NOT QUOTED errdetail("At most one of recovery_target, recovery_target_lsn, recovery_target_name, recovery_target_time, recovery_target_xid may be set."))); {"recovery_target_time", PGC_POSTMASTER, WAL_RECOVERY_TARGET, - NOT QUOTED errdetail("At most one of recovery_target, recovery_target_lsn, recovery_target_name, recovery_target_time, recovery_target_xid may be set."))); GUC_check_errdetail("recovery_target_timeline is not a valid number."); {"recovery_target_name", PGC_POSTMASTER, WAL_RECOVERY_TARGET, - NOT QUOTED errdetail("At most one of recovery_target, recovery_target_lsn, recovery_target_name, recovery_target_time, recovery_target_xid may be set."))); GUC_check_errdetail("%s is too long (maximum %d characters).", "recovery_target_name", MAXFNAMELEN - 1); {"recovery_target_lsn", PGC_POSTMASTER, WAL_RECOVERY_TARGET, - NOT QUOTED errdetail("At most one of recovery_target, recovery_target_lsn, recovery_target_name, recovery_target_time, recovery_target_xid may be set."))); {"primary_conninfo", PGC_SIGHUP, REPLICATION_STANDBY, - NOT QUOTED (errmsg("specified neither primary_conninfo nor restore_command"), {"primary_slot_name", PGC_SIGHUP, REPLICATION_STANDBY, - NONE {"client_encoding", PGC_USERSET, CLIENT_CONN_LOCALE, - QUOTED GUC_check_errdetail("Cannot change \"client_encoding\" now."); - NOT QUOTED errmsg("cannot change client_encoding during a parallel operation"))); {"log_line_prefix", PGC_SIGHUP, LOGGING_WHAT, - NONE {"log_timezone", PGC_SIGHUP, LOGGING_WHAT, - NONE {"DateStyle", PGC_USERSET, CLIENT_CONN_LOCALE, - QUOTED, and note the case is difference from the GUC GUC_check_errdetail("Conflicting \"datestyle\" specifications."); errhint("Perhaps you need a different \"datestyle\" setting."))); {"default_table_access_method", PGC_USERSET, CLIENT_CONN_STATEMENT, - NOT QUOTED GUC_check_errdetail("%s cannot be empty.", "default_table_access_method"); GUC_check_errdetail("%s is too long (maximum %d characters).", "default_table_access_method", NAMEDATALEN - 1); warn_or_exit_horribly(AH, "could not set default_table_access_method: %s", PQerrorMessage(AH->connection)); {"default_tablespace", PGC_USERSET, CLIENT_CONN_STATEMENT, - NOT QUOTED warn_or_exit_horribly(AH, "could not set default_tablespace to %s: %s", fmtId(want), PQerrorMessage(AH->connection)); {"temp_tablespaces", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"createrole_self_grant", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"dynamic_library_path", PGC_SUSET, CLIENT_CONN_OTHER, - QUOTED errmsg("zero-length component in parameter \"dynamic_library_path\""))); errmsg("component in parameter \"dynamic_library_path\" is not an absolute path"))); {"krb_server_keyfile", PGC_SIGHUP, CONN_AUTH_AUTH, - NONE {"bonjour_name", PGC_POSTMASTER, CONN_AUTH_SETTINGS, - NONE {"lc_messages", PGC_SUSET, CLIENT_CONN_LOCALE, - NOT QUOTED pg_fatal("failed to set lc_messages: %s", PQerrorMessage(conn)); {"lc_monetary", PGC_USERSET, CLIENT_CONN_LOCALE, - NONE {"lc_numeric", PGC_USERSET, CLIENT_CONN_LOCALE, - NONE {"lc_time", PGC_USERSET, CLIENT_CONN_LOCALE, - NONE {"session_preload_libraries", PGC_SUSET, CLIENT_CONN_PRELOAD, - NONE {"shared_preload_libraries", PGC_POSTMASTER, CLIENT_CONN_PRELOAD, - NOT QUOTED errmsg("pg_stat_statements must be loaded via shared_preload_libraries"))); errmsg("pg_stat_statements must be loaded via shared_preload_libraries"))); errmsg("pg_stat_statements must be loaded via shared_preload_libraries"))); errmsg("sepgsql must be loaded via shared_preload_libraries"))); errhint("Include the extension module that implements this resource manager in shared_preload_libraries."))); errdetail("Custom resource manager must be registered while initializing modules in shared_preload_libraries."))); errmsg("background worker \"%s\": must be registered in shared_preload_libraries", worker->bgw_name))); errdetail("\"%s\" must be loaded with shared_preload_libraries.", "test_slru"))) {"local_preload_libraries", PGC_USERSET, CLIENT_CONN_PRELOAD, - NONE {"search_path", PGC_USERSET, CLIENT_CONN_STATEMENT, - NOT QUOTED pg_log_error("could not clear search_path: %s", PQerrorMessage(conn)); pg_log_error("failed to set search_path: %s", PQerrorMessage(conn)); pg_log_error("could not clear search_path: %s", PQerrorMessage(tmpconn)); warn_or_exit_horribly(AH, "could not set search_path to \"%s\": %s", schemaName, PQerrorMessage(AH->connection)); pg_log_info("saving search_path = %s", path->data); pg_fatal("could not clear search_path: %s", PQresultErrorMessage(res)); pg_log_error("no pgbench_accounts table found in search_path"); {"server_encoding", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"server_version", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"role", PGC_USERSET, UNGROUPED, - NONE? {"session_authorization", PGC_USERSET, UNGROUPED, - NONE {"log_destination", PGC_SIGHUP, LOGGING_WHERE, - NONE {"log_directory", PGC_SIGHUP, LOGGING_WHERE, - NONE {"log_filename", PGC_SIGHUP, LOGGING_WHERE, - NOT QUOTED errmsg("the log_filename parameter must equal 'postgresql-%%Y-%%m-%%d_%%H%%M%%S.log'"))) {"syslog_ident", PGC_SIGHUP, LOGGING_WHERE, - NONE {"event_source", PGC_POSTMASTER, LOGGING_WHERE, - NONE {"TimeZone", PGC_USERSET, CLIENT_CONN_LOCALE, - NOT QUOTED, need to re-check are these really the GUC name elog(ERROR, "unrecognized timezone type %d", (int) tp->type); (errmsg_internal("timezone directory stack overflow"))); {"timezone_abbreviations", PGC_USERSET, CLIENT_CONN_LOCALE, - NONE {"unix_socket_group", PGC_POSTMASTER, CONN_AUTH_SETTINGS, - NOT QUOTED elog(WARNING, "configuration item unix_socket_group is not supported on this platform"); {"unix_socket_directories", PGC_POSTMASTER, CONN_AUTH_SETTINGS, - NONE {"listen_addresses", PGC_POSTMASTER, CONN_AUTH_SETTINGS, - NONE {"data_directory", PGC_POSTMASTER, FILE_LOCATIONS, - QUOTED write_stderr(... "This can be specified as \"data_directory\" in \"%s\", " ... {"config_file", PGC_POSTMASTER, FILE_LOCATIONS, - NONE {"hba_file", PGC_POSTMASTER, FILE_LOCATIONS, - QUOTED write_stderr(... "This can be specified as \"hba_file\" in \"%s\", "... {"ident_file", PGC_POSTMASTER, FILE_LOCATIONS, - QUOTED write_stderr(... "This can be specified as \"ident_file\" in \"%s\", "... {"external_pid_file", PGC_POSTMASTER, FILE_LOCATIONS, - NONE {"ssl_library", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"ssl_cert_file", PGC_SIGHUP, CONN_AUTH_SSL, - NONE {"ssl_key_file", PGC_SIGHUP, CONN_AUTH_SSL, - NONE {"ssl_ca_file", PGC_SIGHUP, CONN_AUTH_SSL, - NONE {"ssl_crl_file", PGC_SIGHUP, CONN_AUTH_SSL, - NONE {"ssl_crl_dir", PGC_SIGHUP, CONN_AUTH_SSL, - NONE {"synchronous_standby_names", PGC_SIGHUP, REPLICATION_PRIMARY, - NOT QUOTED GUC_check_errdetail("synchronous_standby_names parser failed"); {"default_text_search_config", PGC_USERSET, CLIENT_CONN_LOCALE, - NONE {"ssl_ciphers", PGC_SIGHUP, CONN_AUTH_SSL, - NONE {"ssl_ecdh_curve", PGC_SIGHUP, CONN_AUTH_SSL, - NONE {"ssl_dh_params_file", PGC_SIGHUP, CONN_AUTH_SSL, - NONE {"ssl_passphrase_command", PGC_SIGHUP, CONN_AUTH_SSL, - NOT QUOTED gettext_noop("Controls whether ssl_passphrase_command is called during server reload."), (errmsg("ssl_passphrase_command setting ignored by ssl_passphrase_func module"))); {"application_name", PGC_USERSET, LOGGING_WHAT, - NONE {"cluster_name", PGC_POSTMASTER, PROCESS_TITLE, - NONE {"wal_consistency_checking", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"jit_provider", PGC_POSTMASTER, CLIENT_CONN_PRELOAD, - NONE {"backtrace_functions", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"debug_io_direct", PGC_POSTMASTER, DEVELOPER_OPTIONS, - NOT QUOTED GUC_check_errdetail("debug_io_direct is not supported on this platform.") GUC_check_errdetail("debug_io_direct is not supported for WAL because XLOG_BLCKSZ is too small"); GUC_check_errdetail("debug_io_direct is not supported for data because BLCKSZ is too small"); - QUOTED GUC_check_errdetail("invalid list syntax in parameter \"%s\"", "debug_io_direct"); ~~~ ------------------ ConfigureNamesEnum ------------------ {"backslash_quote", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS, - NONE {"bytea_output", PGC_USERSET, CLIENT_CONN_STATEMENT, - NOT QUOTED elog(ERROR, "unrecognized bytea_output setting: %d", {"client_min_messages", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"compute_query_id", PGC_SUSET, STATS_MONITORING, - NONE {"constraint_exclusion", PGC_USERSET, QUERY_TUNING_OTHER, - NONE {"default_toast_compression", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"default_transaction_isolation", PGC_USERSET, CLIENT_CONN_STATEMENT, - QUOTED errdetail("\"default_transaction_isolation\" is set to \"serializable\"."), {"transaction_isolation", PGC_USERSET, CLIENT_CONN_STATEMENT, - QUOTED errdetail("\"default_transaction_isolation\" is set to \"serializable\"."), {"IntervalStyle", PGC_USERSET, CLIENT_CONN_LOCALE, - NONE {"icu_validation_level", PGC_USERSET, CLIENT_CONN_LOCALE, - QUOTED errhint("To disable ICU locale validation, set the parameter \"%s\" to \"%s\".", "icu_validation_level", "disabled"))); errhint("To disable ICU locale validation, set the parameter \"%s\" to \"%s\".", "icu_validation_level", "disabled"))); {"log_error_verbosity", PGC_SUSET, LOGGING_WHAT, - NONE {"log_min_messages", PGC_SUSET, LOGGING_WHEN, - NONE {"log_min_error_statement", PGC_SUSET, LOGGING_WHEN, - NONE {"log_statement", PGC_SUSET, LOGGING_WHAT, - NONE {"syslog_facility", PGC_SIGHUP, LOGGING_WHERE, - NONE {"session_replication_role", PGC_SUSET, CLIENT_CONN_STATEMENT, - NONE {"synchronous_commit", PGC_USERSET, WAL_SETTINGS, - NONE {"archive_mode", PGC_POSTMASTER, WAL_ARCHIVING, - NOT QUOTED errmsg("archive_mode enabled, yet archiving is not configured"))); {"recovery_target_action", PGC_POSTMASTER, WAL_RECOVERY_TARGET, - NONE {"trace_recovery_messages", PGC_SIGHUP, DEVELOPER_OPTIONS, - NONE {"track_functions", PGC_SUSET, STATS_CUMULATIVE, - NONE {"stats_fetch_consistency", PGC_USERSET, STATS_CUMULATIVE, - NONE {"wal_compression", PGC_SUSET, WAL_SETTINGS, - NONE {"wal_level", PGC_POSTMASTER, WAL_SETTINGS, - NOT QUOTED, and notice some of these option values are quoted and some are not errmsg("WAL was generated with wal_level=minimal, cannot continue recovering") errdetail("This happens if you temporarily set wal_level=minimal on the server."), errhint("Use a backup taken after setting wal_level to higher than minimal."))); errhint("wal_level must be set to \"replica\" or \"logical\" at server start."))); errhint("wal_level must be set to \"replica\" or \"logical\" at server start."))); errmsg("pg_log_standby_snapshot() can only be used if wal_level >= replica"))); errhint("wal_level must be set to \"replica\" or \"logical\" at server start."))); errmsg("wal_level is insufficient to publish logical changes"), errhint("Set wal_level to \"logical\" before creating subscriptions."))); (errmsg("WAL archival cannot be enabled when wal_level is \"minimal\""))); (errmsg("WAL streaming (max_wal_senders > 0) requires wal_level \"replica\" or \"logical\""))); errmsg("replication slots can only be used if wal_level >= replica"))); appendStringInfo(&err_detail, _("Logical decoding on standby requires wal_level >= logical on the primary server.")); errmsg("logical replication slot \"%s\" exists, but wal_level < logical", errhint("Change wal_level to be logical or higher."))); errmsg("physical replication slot \"%s\" exists, but wal_level < replica", errhint("Change wal_level to be replica or higher."))); errmsg("physical replication slot \"%s\" exists, but wal_level < replica", errhint("Change wal_level to be replica or higher."))); errmsg("logical decoding on standby requires wal_level >= logical on the primary"))); errmsg("logical decoding requires wal_level >= logical"))); errmsg("logical decoding on standby requires wal_level >= logical on the primary"))); {"dynamic_shared_memory_type", PGC_POSTMASTER, RESOURCES_MEM, - NONE {"shared_memory_type", PGC_POSTMASTER, RESOURCES_MEM, - NOT QUOTED errmsg("huge pages not supported with the current shared_memory_type setting"))); {"wal_sync_method", PGC_SIGHUP, WAL_SETTINGS, - NOT QUOTED elog(ERROR, "unrecognized wal_sync_method: %d", method); elog(PANIC, "unrecognized wal_sync_method: %d", sync_method); {"xmlbinary", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"xmloption", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"huge_pages", PGC_POSTMASTER, RESOURCES_MEM, - NONE {"recovery_prefetch", PGC_SIGHUP, WAL_RECOVERY, - NOT QUOTED GUC_check_errdetail("recovery_prefetch is not supported on platforms that lack posix_fadvise()."); {"debug_parallel_query", PGC_USERSET, DEVELOPER_OPTIONS, - NONE {"password_encryption", PGC_USERSET, CONN_AUTH_AUTH, - NOT QUOTED libpq_append_conn_error(conn, "password_encryption value too long"); {"plan_cache_mode", PGC_USERSET, QUERY_TUNING_OTHER, - NONE {"ssl_min_protocol_version", PGC_SIGHUP, CONN_AUTH_SSL, - QUOTED (errmsg("\"%s\" setting \"%s\" not supported by this build", "ssl_min_protocol_version", GetConfigOption("ssl_min_protocol_version", false, false)))); - NOT QUOTED libpq_append_conn_error(conn, "invalid %s value: \"%s\"", "ssl_min_protocol_version", conn->ssl_min_protocol_version); {"ssl_max_protocol_version", PGC_SIGHUP, CONN_AUTH_SSL, - QUOTED (errmsg("\"%s\" setting \"%s\" not supported by this build", "ssl_max_protocol_version", GetConfigOption("ssl_max_protocol_version", false, false)))); errdetail("\"%s\" cannot be higher than \"%s\"", "ssl_min_protocol_version", "ssl_max_protocol_version"))); - NOT QUOTED libpq_append_conn_error(conn, "invalid %s value: \"%s\"", "ssl_max_protocol_version", conn->ssl_max_protocol_version); {"recovery_init_sync_method", PGC_SIGHUP, ERROR_HANDLING_OPTIONS, - NONE {"debug_logical_replication_streaming", PGC_USERSET, DEVELOPER_OPTIONS, - NONE [end] Attachments: [text/plain] 20231107-guc-names-in-messages-data.txt (43.5K, ../../CAHut+PtqTao+OKRxGcCzUxt9h9d0=TQZZoRjMYe3xe0-O7_hsQ@mail.gmail.com/2-20231107-guc-names-in-messages-data.txt) download | inline: Hi I used regex search: ".*GUCNAME to find how each GUCNAME is used in messages in *.c files. GUC names are taken from the guc_tables.c code, so are grouped accordingly below. I've categorised them as being currently QUOTED, NOT QUOTED, and NONE (many are not used in any messages). ~TOTALS: messages where GUC names are quoted: - bool = 11 - int = 11 - real = 0 - string = 10 - enum = 7 - TOTAL = 39 messages where GUC names are NOT quoted: - bool = 14 - int = 60 - real = 0 - string = 59 - enum = 31 - TOTAL = 164 Details below... /////////////////////////// ------------------ ConfigureNamesBool ------------------ {"enable_seqscan", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_indexscan", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_indexonlyscan", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_bitmapscan", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_tidscan", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_sort", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_incremental_sort", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_hashagg", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_material", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_memoize", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_nestloop", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_mergejoin", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_hashjoin", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_gathermerge", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_partitionwise_join", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_partitionwise_aggregate", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_parallel_append", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_parallel_hash", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_partition_pruning", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_presorted_aggregate", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"enable_async_append", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"geqo", PGC_USERSET, QUERY_TUNING_GEQO, - NONE {"is_superuser", PGC_INTERNAL, UNGROUPED, - NONE {"bonjour", PGC_POSTMASTER, CONN_AUTH_SETTINGS, - NONE {"track_commit_timestamp", PGC_POSTMASTER, REPLICATION_SENDING, - QUOTED errhint("Make sure the configuration parameter \"%s\" is set on the primary server.", "track_commit_timestamp") : errhint("Make sure the configuration parameter \"%s\" is set.", "track_commit_timestamp"))); {"ssl", PGC_SIGHUP, CONN_AUTH_SSL, - NOT QUOTED errhint("Set ssl = on in postgresql.conf."), {"ssl_passphrase_command_supports_reload", PGC_SIGHUP, CONN_AUTH_SSL, - NONE {"ssl_prefer_server_ciphers", PGC_SIGHUP, CONN_AUTH_SSL, - NONE {"fsync", PGC_SIGHUP, WAL_SETTINGS, - NONE {"zero_damaged_pages", PGC_SUSET, DEVELOPER_OPTIONS, - NOT QUOTED gettext_noop(... Setting " "zero_damaged_pages to true causes the system to instead report a "... {"ignore_invalid_pages", PGC_POSTMASTER, DEVELOPER_OPTIONS, - NOT QUOTED gettext_noop(... "Setting ignore_invalid_pages to true causes " {"full_page_writes", PGC_SIGHUP, WAL_SETTINGS, - NOT QUOTED errmsg("WAL generated with full_page_writes=off was replayed ""since last restartpoint"), errhint(... "Enable full_page_writes and run CHECKPOINT on the primary, ""and then try an online backup again."))); errmsg("WAL generated with full_page_writes=off was replayed ""during online backup"),\ errhint(... "Enable full_page_writes and run CHECKPOINT on the primary, " "and then try an online backup again."))); pg_fatal("full_page_writes must be enabled in the source server"); {"wal_log_hints", PGC_POSTMASTER, WAL_SETTINGS, - QUOTED, but this quotes everything -- not just the GUC name "target server needs to use either data checksums or \"wal_log_hints = on\""); {"wal_init_zero", PGC_SUSET, WAL_SETTINGS, - NONE {"wal_recycle", PGC_SUSET, WAL_SETTINGS, - NONE {"log_checkpoints", PGC_SIGHUP, LOGGING_WHAT, - NONE {"log_connections", PGC_SU_BACKEND, LOGGING_WHAT, - NONE {"log_disconnections", PGC_SU_BACKEND, LOGGING_WHAT, - NONE {"log_replication_commands", PGC_SUSET, LOGGING_WHAT, - NONE {"debug_assertions", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"exit_on_error", PGC_USERSET, ERROR_HANDLING_OPTIONS, - NONE {"restart_after_crash", PGC_SIGHUP, ERROR_HANDLING_OPTIONS, - NOT QUOTED (errmsg("shutting down because restart_after_crash is off"))); {"remove_temp_files_after_crash", PGC_SIGHUP, DEVELOPER_OPTIONS, - NONE {"send_abort_for_crash", PGC_SIGHUP, DEVELOPER_OPTIONS, - NONE {"send_abort_for_kill", PGC_SIGHUP, DEVELOPER_OPTIONS, - NONE {"log_duration", PGC_SUSET, LOGGING_WHAT, - NONE {"debug_print_parse", PGC_USERSET, LOGGING_WHAT, - NONE {"debug_print_rewritten", PGC_USERSET, LOGGING_WHAT, - NONE {"debug_print_plan", PGC_USERSET, LOGGING_WHAT, - NONE {"debug_pretty_print", PGC_USERSET, LOGGING_WHAT, - NONE {"log_parser_stats", PGC_SUSET, STATS_MONITORING, - QUOTED GUC_check_errdetail("Cannot enable \"log_statement_stats\" when ""\"log_parser_stats\", \"log_planner_stats\", ""or \"log_executor_stats\" is true."); {"log_planner_stats", PGC_SUSET, STATS_MONITORING, - QUOTED GUC_check_errdetail("Cannot enable \"log_statement_stats\" when ""\"log_parser_stats\", \"log_planner_stats\", ""or \"log_executor_stats\" is true."); {"log_executor_stats", PGC_SUSET, STATS_MONITORING, - QUOTED GUC_check_errdetail("Cannot enable \"log_statement_stats\" when ""\"log_parser_stats\", \"log_planner_stats\", ""or \"log_executor_stats\" is true.") {"log_statement_stats", PGC_SUSET, STATS_MONITORING, - QUOTED GUC_check_errdetail("Cannot enable parameter when \"log_statement_stats\" is true."); GUC_check_errdetail("Cannot enable \"log_statement_stats\" when ""\"log_parser_stats\", \"log_planner_stats\", ""or \"log_executor_stats\" is true."); {"log_btree_build_stats", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"track_activities", PGC_SUSET, STATS_CUMULATIVE, - NONE {"track_counts", PGC_SUSET, STATS_CUMULATIVE, - NONE {"track_io_timing", PGC_SUSET, STATS_CUMULATIVE, - NONE {"track_wal_io_timing", PGC_SUSET, STATS_CUMULATIVE, - NONE {"update_process_title", PGC_SUSET, PROCESS_TITLE, - NONE {"autovacuum", PGC_SIGHUP, AUTOVACUUM, - NONE {"trace_notify", PGC_USERSET, DEVELOPER_OPTIONS, - NONE {"trace_locks", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"trace_userlocks", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"trace_lwlocks", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"debug_deadlocks", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"log_lock_waits", PGC_SUSET, LOGGING_WHAT, - NONE {"log_recovery_conflict_waits", PGC_SIGHUP, LOGGING_WHAT, - NONE {"log_hostname", PGC_SIGHUP, LOGGING_WHAT, - NONE {"transform_null_equals", PGC_USERSET, COMPAT_OPTIONS_CLIENT, - NONE {"db_user_namespace", PGC_SIGHUP, CONN_AUTH_AUTH, - QUOTED errmsg("MD5 authentication is not supported when \"db_user_namespace\" is enabled"))) errmsg("MD5 authentication is not supported when \"db_user_namespace\" is enabled"), *err_msg = "MD5 authentication is not supported when \"db_user_namespace\" is enabled"; {"default_transaction_read_only", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"transaction_read_only", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"default_transaction_deferrable", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"transaction_deferrable", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"row_security", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"check_function_bodies", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"array_nulls", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS, - NONE {"default_with_oids", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS, - NONE {"logging_collector", PGC_POSTMASTER, LOGGING_WHERE, - NONE {"log_truncate_on_rotation", PGC_SIGHUP, LOGGING_WHERE, - NONE {"trace_sort", PGC_USERSET, DEVELOPER_OPTIONS, - NONE {"trace_syncscan", PGC_USERSET, DEVELOPER_OPTIONS, - NONE "optimize_bounded_sort", PGC_USERSET, QUERY_TUNING_METHOD, - NONE {"wal_debug", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"integer_datetimes", PGC_INTERNAL, PRESET_OPTIONS, - NOT QUOTED pg_log_error("could not determine server setting for integer_datetimes"); pg_log_error("integer_datetimes compile flag does not match server"); {"krb_caseins_users", PGC_SIGHUP, CONN_AUTH_AUTH, - NONE {"gss_accept_delegation", PGC_SIGHUP, CONN_AUTH_AUTH, - NONE {"escape_string_warning", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS, - NONE {"standard_conforming_strings", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS, - NOT QUOTED errdetail("String constants with Unicode escapes cannot be used when standard_conforming_strings is off."), pg_log_info("saving standard_conforming_strings = %s", stdstrings); {"synchronize_seqscans", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS, - NONE {"recovery_target_inclusive", PGC_POSTMASTER, WAL_RECOVERY_TARGET, - NONE {"hot_standby", PGC_POSTMASTER, REPLICATION_STANDBY, - NONE {"hot_standby_feedback", PGC_SIGHUP, REPLICATION_STANDBY, - NONE {"in_hot_standby", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"allow_system_table_mods", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"ignore_system_indexes", PGC_BACKEND, DEVELOPER_OPTIONS, - NONE {"allow_in_place_tablespaces", PGC_SUSET, DEVELOPER_OPTIONS, - NOT QUOTED errhint("Remove those directories, or set allow_in_place_tablespaces to ON transiently to let recovery complete."))); {"lo_compat_privileges", PGC_SUSET, COMPAT_OPTIONS_PREVIOUS, - NONE {"quote_all_identifiers", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS, - NONE {"data_checksums", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"syslog_sequence_numbers", PGC_SIGHUP, LOGGING_WHERE, - NONE {"syslog_split_messages", PGC_SIGHUP, LOGGING_WHERE, - NONE {"parallel_leader_participation", PGC_USERSET, RESOURCES_ASYNCHRONOUS, - NONE {"jit", PGC_USERSET, QUERY_TUNING_OTHER, - NONE {"jit_debugging_support", PGC_SU_BACKEND, DEVELOPER_OPTIONS, - NONE {"jit_dump_bitcode", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"jit_expressions", PGC_USERSET, DEVELOPER_OPTIONS, - NONE {"jit_profiling_support", PGC_SU_BACKEND, DEVELOPER_OPTIONS, - NONE {"jit_tuple_deforming", PGC_USERSET, DEVELOPER_OPTIONS, - NONE {"data_sync_retry", PGC_POSTMASTER, ERROR_HANDLING_OPTIONS, - NONE {"wal_receiver_create_temp_slot", PGC_SIGHUP, REPLICATION_STANDBY, - NONE ~~~ ----------------- ConfigureNamesInt ----------------- {"archive_timeout", PGC_SIGHUP, WAL_ARCHIVING, - NOT QUOTED elog(DEBUG1, "write-ahead log switch forced (archive_timeout=%d)", XLogArchiveTimeout); {"post_auth_delay", PGC_BACKEND, DEVELOPER_OPTIONS, - NONE {"default_statistics_target", PGC_USERSET, QUERY_TUNING_OTHER, - NONE {"from_collapse_limit", PGC_USERSET, QUERY_TUNING_OTHER, - NONE {"join_collapse_limit", PGC_USERSET, QUERY_TUNING_OTHER, - NONE {"geqo_threshold", PGC_USERSET, QUERY_TUNING_GEQO, - NONE {"geqo_effort", PGC_USERSET, QUERY_TUNING_GEQO, - NONE {"geqo_pool_size", PGC_USERSET, QUERY_TUNING_GEQO, - NONE {"geqo_generations", PGC_USERSET, QUERY_TUNING_GEQO, - NONE {"deadlock_timeout", PGC_SUSET, LOCK_MANAGEMENT, - NONE {"max_standby_archive_delay", PGC_SIGHUP, REPLICATION_STANDBY, - NONE {"max_standby_streaming_delay", PGC_SIGHUP, REPLICATION_STANDBY, - NONE {"recovery_min_apply_delay", PGC_SIGHUP, REPLICATION_STANDBY, - NONE {"wal_receiver_status_interval", PGC_SIGHUP, REPLICATION_STANDBY, - NONE {"wal_receiver_timeout", PGC_SIGHUP, REPLICATION_STANDBY, - NONE {"max_connections", PGC_POSTMASTER, CONN_AUTH_SETTINGS, - NOT QUOTED errhint(...consumption of semaphores by reducing its max_connections parameter.\n" "The PostgreSQL documentation contains more information about "... errhint("This error usually means that PostgreSQL's request ... perhaps by reducing shared_buffers or ""max_connections.", write_stderr("%s: superuser_reserved_connections (%d) plus reserved_connections (%d) must be less than max_connections (%d)\n", errhint("You might need to run fewer transactions at a time or increase max_connections."))); errhint("You might need to run fewer transactions at a time or increase max_connections."))); printf(_("selecting default max_connections ... ")); {"superuser_reserved_connections", PGC_POSTMASTER, CONN_AUTH_SETTINGS, - NOT QUOTED write_stderr("%s: superuser_reserved_connections (%d) plus reserved_connections (%d) must be less than max_connections (%d)\n", {"reserved_connections", PGC_POSTMASTER, CONN_AUTH_SETTINGS, - NOT QUOTED write_stderr("%s: superuser_reserved_connections (%d) plus reserved_connections (%d) must be less than max_connections (%d)\n", {"min_dynamic_shared_memory", PGC_POSTMASTER, RESOURCES_MEM, - NONE {"shared_buffers", PGC_POSTMASTER, RESOURCES_MEM, - NOT QUOTED errhint("This error usually means that PostgreSQL's request "..."memory usage, perhaps by reducing shared_buffers or ""max_connections.", printf(_("selecting default shared_buffers ... ")); {"vacuum_buffer_usage_limit", PGC_USERSET, RESOURCES_MEM, - QUOTED GUC_check_errdetail("\"vacuum_buffer_usage_limit\" must be 0 or between %d kB and %d kB",MIN_BAS_VAC_RING_SIZE_KB, MAX_BAS_VAC_RING_SIZE_KB); {"shared_memory_size", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"shared_memory_size_in_huge_pages", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"temp_buffers", PGC_USERSET, RESOURCES_MEM, - QUOTED GUC_check_errdetail("\"temp_buffers\" cannot be changed after any temporary tables have been accessed in the session."); {"port", PGC_POSTMASTER, CONN_AUTH_SETTINGS, - NONE? {"unix_socket_permissions", PGC_POSTMASTER, CONN_AUTH_SETTINGS, - NONE {"log_file_mode", PGC_SIGHUP, LOGGING_WHERE, - NONE {"data_directory_mode", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"work_mem", PGC_USERSET, RESOURCES_MEM, - NOT QUOTED gettext_noop("Multiple of work_mem to use for hash tables."), {"maintenance_work_mem", PGC_USERSET, RESOURCES_MEM, - NOT QUOTED errhint("Reduce maintenance_work_mem."))); - QUOTED errhint("Consider increasing configuration parameter \"maintenance_work_mem\" or \"autovacuum_work_mem\".\n" {"logical_decoding_work_mem", PGC_USERSET, RESOURCES_MEM, - NONE {"max_stack_depth", PGC_SUSET, RESOURCES_MEM, - QUOTED errhint("Increase the configuration parameter \"max_stack_depth\" (currently %dkB), ""after ensuring the platform's stack depth limit is adequate.", GUC_check_errdetail("\"max_stack_depth\" must not exceed %ldkB.",(stack_rlimit - STACK_DEPTH_SLOP) / 1024L); {"temp_file_limit", PGC_SUSET, RESOURCES_DISK, - NONE {"vacuum_cost_page_hit", PGC_USERSET, RESOURCES_VACUUM_DELAY, - NONE {"vacuum_cost_page_miss", PGC_USERSET, RESOURCES_VACUUM_DELAY, - NONE {"vacuum_cost_page_dirty", PGC_USERSET, RESOURCES_VACUUM_DELAY, - NONE {"vacuum_cost_limit", PGC_USERSET, RESOURCES_VACUUM_DELAY, - NONE {"autovacuum_vacuum_cost_limit", PGC_SIGHUP, AUTOVACUUM, - NONE {"max_files_per_process", PGC_POSTMASTER, RESOURCES_KERNEL, - NONE {"max_prepared_transactions", PGC_POSTMASTER, RESOURCES_MEM, - NOT QUOTED errhint("Set max_prepared_transactions to a nonzero value."))); errhint("Increase max_prepared_transactions (currently %d).", max_prepared_xacts))); errhint("Increase max_prepared_transactions (currently %d).", max_prepared_xacts))); {"trace_lock_oidmin", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"trace_lock_table", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"statement_timeout", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"lock_timeout", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"idle_in_transaction_session_timeout", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"idle_session_timeout", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"vacuum_freeze_min_age", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"vacuum_freeze_table_age", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"vacuum_multixact_freeze_min_age", PGC_USERSET, CLIENT_CONN_STATEMENT, - NOT QUOTED errhint("Execute a database-wide VACUUM in database with OID %u with reduced vacuum_multixact_freeze_min_age and... errhint("Execute a database-wide VACUUM in that database with reduced vacuum_multixact_freeze_min_age and... {"vacuum_multixact_freeze_table_age", PGC_USERSET, CLIENT_CONN_STATEMENT, - NOT QUOTED errhint(... with OID %u with reduced vacuum_multixact_freeze_min_age and vacuum_multixact_freeze_table_age settings.", errhint(... with reduced vacuum_multixact_freeze_min_age and vacuum_multixact_freeze_table_age settings."))); {"vacuum_failsafe_age", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"vacuum_multixact_failsafe_age", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"max_locks_per_transaction", PGC_POSTMASTER, LOCK_MANAGEMENT, - NOT QUOTED errhint("You might need to increase %s.", "max_locks_per_transaction"))); errhint("You might need to increase %s.", "max_locks_per_transaction"))); errhint("You might need to increase %s.", "max_locks_per_transaction"))); errhint("You might need to increase %s.", "max_locks_per_transaction"))); errhint("You might need to increase %s.", "max_locks_per_transaction"))); errhint("You might need to increase %s.", "max_locks_per_transaction"))); gettext_noop(... "max_locks_per_transaction objects per server process or prepared "...) {"max_pred_locks_per_transaction", PGC_POSTMASTER, LOCK_MANAGEMENT, - NOT QUOTED errhint("You might need to increase %s.", "max_pred_locks_per_transaction"))); errhint("You might need to increase %s.", "max_pred_locks_per_transaction"))); errhint("You might need to increase %s.", "max_pred_locks_per_transaction"))); gettext_noop(..."at most max_pred_locks_per_transaction objects per server process "...) {"max_pred_locks_per_relation", PGC_SIGHUP, LOCK_MANAGEMENT, - NONE {"max_pred_locks_per_page", PGC_SIGHUP, LOCK_MANAGEMENT, - NONE {"authentication_timeout", PGC_SIGHUP, CONN_AUTH_AUTH, - NONE {"pre_auth_delay", PGC_SIGHUP, DEVELOPER_OPTIONS, - NONE {"wal_decode_buffer_size", PGC_POSTMASTER, WAL_RECOVERY, - NONE {"wal_keep_size", PGC_SIGHUP, REPLICATION_SENDING, - NONE {"min_wal_size", PGC_SIGHUP, WAL_CHECKPOINTS, - QUOTED errmsg("\"min_wal_size\" must be at least twice \"wal_segment_size\""))); {"max_wal_size", PGC_SIGHUP, WAL_CHECKPOINTS, - QUOTED errmsg("\"max_wal_size\" must be at least twice \"wal_segment_size\""))); errhint("Consider increasing the configuration parameter \"max_wal_size\"."))); {"checkpoint_timeout", PGC_SIGHUP, WAL_CHECKPOINTS, - NONE {"checkpoint_warning", PGC_SIGHUP, WAL_CHECKPOINTS, - NONE {"checkpoint_flush_after", PGC_SIGHUP, WAL_CHECKPOINTS, - NONE {"wal_buffers", PGC_POSTMASTER, WAL_SETTINGS, - NONE {"wal_writer_delay", PGC_SIGHUP, WAL_SETTINGS, - NONE {"wal_writer_flush_after", PGC_SIGHUP, WAL_SETTINGS, - NONE {"wal_skip_threshold", PGC_USERSET, WAL_SETTINGS, - NONE {"max_wal_senders", PGC_POSTMASTER, REPLICATION_SENDING, - NOT QUOTED (errmsg("WAL streaming (max_wal_senders > 0) requires wal_level \"replica\" or \"logical\""))); errmsg("number of requested standby connections exceeds max_wal_senders (currently %d)", max_wal_senders))); {"max_replication_slots", PGC_POSTMASTER, REPLICATION_SENDING, - NOT QUOTED errhint("Free one or increase max_replication_slots."))); errmsg("replication slots can only be used if max_replication_slots > 0"))); errhint("Increase max_replication_slots and try again."))); errmsg("cannot start logical replication workers when max_replication_slots = 0"))); errmsg("cannot query or manipulate replication origin when max_replication_slots = 0"))); errmsg("could not find free replication state, increase max_replication_slots"))); errhint("Increase max_replication_slots and try again."))); errhint("Increase max_replication_slots and try again."))); {"max_slot_wal_keep_size", PGC_SIGHUP, REPLICATION_SENDING, - NOT QUOTED hint ? errhint("You might need to increase %s.", "max_slot_wal_keep_size") : 0); {"wal_sender_timeout", PGC_USERSET, REPLICATION_SENDING, - NONE {"commit_delay", PGC_SUSET, WAL_SETTINGS, - NOT QUOTED gettext_noop("Sets the minimum number of concurrent open transactions ""required before performing commit_delay.") {"commit_siblings", PGC_USERSET, WAL_SETTINGS, - NONE {"extra_float_digits", PGC_USERSET, CLIENT_CONN_LOCALE, - NONE {"log_min_duration_sample", PGC_SUSET, LOGGING_WHEN, - NOT QUOTED gettext_noop("Fraction of statements exceeding log_min_duration_sample to be logged."), {"log_min_duration_statement", PGC_SUSET, LOGGING_WHEN, - NONE {"log_autovacuum_min_duration", PGC_SIGHUP, LOGGING_WHAT, - NONE {"log_parameter_max_length", PGC_SUSET, LOGGING_WHAT, - NONE {"log_parameter_max_length_on_error", PGC_USERSET, LOGGING_WHAT, - NONE {"bgwriter_delay", PGC_SIGHUP, RESOURCES_BGWRITER, - NONE {"bgwriter_lru_maxpages", PGC_SIGHUP, RESOURCES_BGWRITER, - NONE {"bgwriter_flush_after", PGC_SIGHUP, RESOURCES_BGWRITER, - NONE {"effective_io_concurrency", - NOT QUOTED GUC_check_errdetail("effective_io_concurrency must be set to 0 on platforms that lack posix_fadvise()."); gettext_noop("A variant of effective_io_concurrency that is used for maintenance work."), {"maintenance_io_concurrency", - NOT QUOTED GUC_check_errdetail("maintenance_io_concurrency must be set to 0 on platforms that lack posix_fadvise()."); {"backend_flush_after", PGC_USERSET, RESOURCES_ASYNCHRONOUS, - NONE {"max_worker_processes", - NOT QUOTED, but note probably some of these should be making use of common style "You may need to increase %s." errhint("You may need to increase max_worker_processes."))); errhint("Consider increasing configuration parameter \"max_worker_processes\"."))); (errmsg("inconsistent background worker state (max_worker_processes=%d, total_slots=%d)",...))); errhint("Consider increasing the configuration parameter \"max_worker_processes\"."))); errhint("You might need to increase %s.", "max_worker_processes"))); errhint("You may need to increase max_worker_processes."))); {"max_logical_replication_workers", - NOT QUOTED errhint("You might need to increase %s.", "max_logical_replication_workers"))); {"max_sync_workers_per_subscription", - NONE {"max_parallel_apply_workers_per_subscription", - NONE {"log_rotation_age", PGC_SIGHUP, LOGGING_WHERE, - NONE {"log_rotation_size", PGC_SIGHUP, LOGGING_WHERE, - NONE {"max_function_args", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"max_index_keys", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"max_identifier_length", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"block_size", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"segment_size", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"wal_block_size", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"wal_retrieve_retry_interval", PGC_SIGHUP, REPLICATION_STANDBY, - NONE {"wal_segment_size", PGC_INTERNAL, PRESET_OPTIONS, - QUOTED errmsg("\"min_wal_size\" must be at least twice \"wal_segment_size\""))); errmsg("\"max_wal_size\" must be at least twice \"wal_segment_size\""))); {"autovacuum_naptime", PGC_SIGHUP, AUTOVACUUM, - NONE {"autovacuum_vacuum_threshold", PGC_SIGHUP, AUTOVACUUM, - NONE {"autovacuum_vacuum_insert_threshold", PGC_SIGHUP, AUTOVACUUM, - NONE {"autovacuum_analyze_threshold", PGC_SIGHUP, AUTOVACUUM, - NONE {"autovacuum_freeze_max_age", PGC_POSTMASTER, AUTOVACUUM, - NONE {"autovacuum_multixact_freeze_max_age", PGC_POSTMASTER, AUTOVACUUM, - NONE {"autovacuum_max_workers", PGC_POSTMASTER, AUTOVACUUM, - NONE {"max_parallel_maintenance_workers", PGC_USERSET, RESOURCES_ASYNCHRONOUS, - NONE {"max_parallel_workers_per_gather", PGC_USERSET, RESOURCES_ASYNCHRONOUS, - NONE {"max_parallel_workers", PGC_USERSET, RESOURCES_ASYNCHRONOUS, - NONE {"autovacuum_work_mem", PGC_SIGHUP, RESOURCES_MEM, - QUOTED errhint("Consider increasing configuration parameter \"maintenance_work_mem\" or \"autovacuum_work_mem\".\n"...))); {"old_snapshot_threshold", PGC_POSTMASTER, RESOURCES_ASYNCHRONOUS, - NONE {"tcp_keepalives_idle", PGC_USERSET, CONN_AUTH_TCP, - NONE {"tcp_keepalives_interval", PGC_USERSET, CONN_AUTH_TCP, - NONE {"ssl_renegotiation_limit", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS, - NONE {"tcp_keepalives_count", PGC_USERSET, CONN_AUTH_TCP, - NONE {"gin_fuzzy_search_limit", PGC_USERSET, CLIENT_CONN_OTHER, - NONE {"effective_cache_size", PGC_USERSET, QUERY_TUNING_COST, - NONE {"min_parallel_table_scan_size", PGC_USERSET, QUERY_TUNING_COST, - NONE {"min_parallel_index_scan_size", PGC_USERSET, QUERY_TUNING_COST, - NONE {"server_version_num", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"log_temp_files", PGC_SUSET, LOGGING_WHAT, - NONE {"gin_pending_list_limit", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"tcp_user_timeout", PGC_USERSET, CONN_AUTH_TCP, - NOT QUOTED, althought I am not sure if this really is the GUC (errmsg("%s(%s) failed: %m", "getsockopt", "TCP_USER_TIMEOUT"))); (errmsg("%s(%s) failed: %m", "setsockopt", "TCP_USER_TIMEOUT"))); (errmsg("%s(%s) not supported", "setsockopt", "TCP_USER_TIMEOUT"))); {"huge_page_size", PGC_POSTMASTER, RESOURCES_MEM, - NOT QUOTED GUC_check_errdetail("huge_page_size must be 0 on this platform."); GUC_check_errdetail("huge_page_size must be 0 on this platform."); {"debug_discard_caches", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"client_connection_check_interval", PGC_USERSET, CONN_AUTH_TCP, - NOT QUOTED GUC_check_errdetail("client_connection_check_interval must be set to 0 on this platform."); {"log_startup_progress_interval", PGC_SIGHUP, LOGGING_WHEN, - NONE {"scram_iterations", PGC_USERSET, CONN_AUTH_AUTH, - NONE ~~~ ------------------ ConfigureNamesReal ------------------ {"seq_page_cost", PGC_USERSET, QUERY_TUNING_COST, - NONE {"random_page_cost", PGC_USERSET, QUERY_TUNING_COST, - NONE {"cpu_tuple_cost", PGC_USERSET, QUERY_TUNING_COST, - NONE {"cpu_index_tuple_cost", PGC_USERSET, QUERY_TUNING_COST, - NONE {"cpu_operator_cost", PGC_USERSET, QUERY_TUNING_COST, - NONE {"parallel_tuple_cost", PGC_USERSET, QUERY_TUNING_COST, - NONE {"parallel_setup_cost", PGC_USERSET, QUERY_TUNING_COST, - NONE {"jit_above_cost", PGC_USERSET, QUERY_TUNING_COST, - NONE {"jit_optimize_above_cost", PGC_USERSET, QUERY_TUNING_COST, - NONE {"jit_inline_above_cost", PGC_USERSET, QUERY_TUNING_COST, - NONE {"cursor_tuple_fraction", PGC_USERSET, QUERY_TUNING_OTHER, - NONE {"recursive_worktable_factor", PGC_USERSET, QUERY_TUNING_OTHER, - NONE {"geqo_selection_bias", PGC_USERSET, QUERY_TUNING_GEQO, - NONE {"geqo_seed", PGC_USERSET, QUERY_TUNING_GEQO, - NONE {"hash_mem_multiplier", PGC_USERSET, RESOURCES_MEM, - NONE {"bgwriter_lru_multiplier", PGC_SIGHUP, RESOURCES_BGWRITER, - NONE {"seed", PGC_USERSET, UNGROUPED, - NONE? {"vacuum_cost_delay", PGC_USERSET, RESOURCES_VACUUM_DELAY, - NONE {"autovacuum_vacuum_cost_delay", PGC_SIGHUP, AUTOVACUUM, - NONE {"autovacuum_vacuum_scale_factor", PGC_SIGHUP, AUTOVACUUM, - NONE {"autovacuum_vacuum_insert_scale_factor", PGC_SIGHUP, AUTOVACUUM, - NONE {"autovacuum_analyze_scale_factor", PGC_SIGHUP, AUTOVACUUM, - NONE {"checkpoint_completion_target", PGC_SIGHUP, WAL_CHECKPOINTS, - NONE {"log_statement_sample_rate", PGC_SUSET, LOGGING_WHEN, - NONE {"log_transaction_sample_rate", PGC_SUSET, LOGGING_WHEN, - NONE ~~~ -------------------- ConfigureNamesString -------------------- {"archive_command", PGC_SIGHUP, WAL_ARCHIVING, - NOT QUOTED errhint("Check that your archive_command is executing properly. " errmsg("both archive_command and archive_library set"), errdetail("Only one of archive_command, archive_library may be set."))); errmsg("both archive_command and archive_library set"), errdetail("Only one of archive_command, archive_library may be set."))); gettext_noop("Allows archiving of WAL files using archive_command."), - QUOTED gettext_noop("An empty string indicates that \"archive_command\" should be used.") {"archive_library", PGC_SIGHUP, WAL_ARCHIVING, - NOT QUOTED errmsg("both archive_command and archive_library set"), errdetail("Only one of archive_command, archive_library may be set."))); errmsg("both archive_command and archive_library set"), errdetail("Only one of archive_command, archive_library may be set."))) - QUOTED (errmsg("restarting archiver process because value of " "\"archive_library\" was changed"))); gettext_noop("This is used only if \"archive_library\" is not set.") {"restore_command", PGC_SIGHUP, WAL_ARCHIVE_RECOVERY, - NOT QUOTED errdetail("restore_command returned a zero exit status, but stat() failed."))); (errmsg("specified neither primary_conninfo nor restore_command"), errmsg("must specify restore_command when standby mode is not enabled"))); pg_fatal("restore_command is not set in the target cluster"); pg_log_debug("using for rewind restore_command = \'%s\'", pg_fatal("restore_command failed: %s", wait_result_to_str(rc)); {"archive_cleanup_command", PGC_SIGHUP, WAL_ARCHIVE_RECOVERY, - NONE {"recovery_end_command", PGC_SIGHUP, WAL_ARCHIVE_RECOVERY, - NOT QUOTED (errmsg("%s \"%s\": %s", commandName, command, wait_result_to_str(rc)))); {"recovery_target_timeline", PGC_POSTMASTER, WAL_RECOVERY_TARGET, - NOT QUOTED GUC_check_errdetail("recovery_target_timeline is not a valid number."); {"recovery_target", PGC_POSTMASTER, WAL_RECOVERY_TARGET, - NOT QUOTED errdetail("At most one of recovery_target, recovery_target_lsn, recovery_target_name, recovery_target_time, recovery_target_xid may be set."))); GUC_check_errdetail("%s is too long (maximum %d characters).", "recovery_target_name", MAXFNAMELEN - 1) GUC_check_errdetail("recovery_target_timeline is not a valid number."); {"recovery_target_xid", PGC_POSTMASTER, WAL_RECOVERY_TARGET, - NOT QUOTED errdetail("At most one of recovery_target, recovery_target_lsn, recovery_target_name, recovery_target_time, recovery_target_xid may be set."))); {"recovery_target_time", PGC_POSTMASTER, WAL_RECOVERY_TARGET, - NOT QUOTED errdetail("At most one of recovery_target, recovery_target_lsn, recovery_target_name, recovery_target_time, recovery_target_xid may be set."))); GUC_check_errdetail("recovery_target_timeline is not a valid number."); {"recovery_target_name", PGC_POSTMASTER, WAL_RECOVERY_TARGET, - NOT QUOTED errdetail("At most one of recovery_target, recovery_target_lsn, recovery_target_name, recovery_target_time, recovery_target_xid may be set."))); GUC_check_errdetail("%s is too long (maximum %d characters).", "recovery_target_name", MAXFNAMELEN - 1); {"recovery_target_lsn", PGC_POSTMASTER, WAL_RECOVERY_TARGET, - NOT QUOTED errdetail("At most one of recovery_target, recovery_target_lsn, recovery_target_name, recovery_target_time, recovery_target_xid may be set."))); {"primary_conninfo", PGC_SIGHUP, REPLICATION_STANDBY, - NOT QUOTED (errmsg("specified neither primary_conninfo nor restore_command"), {"primary_slot_name", PGC_SIGHUP, REPLICATION_STANDBY, - NONE {"client_encoding", PGC_USERSET, CLIENT_CONN_LOCALE, - QUOTED GUC_check_errdetail("Cannot change \"client_encoding\" now."); - NOT QUOTED errmsg("cannot change client_encoding during a parallel operation"))); {"log_line_prefix", PGC_SIGHUP, LOGGING_WHAT, - NONE {"log_timezone", PGC_SIGHUP, LOGGING_WHAT, - NONE {"DateStyle", PGC_USERSET, CLIENT_CONN_LOCALE, - QUOTED, and note the case is difference from the GUC GUC_check_errdetail("Conflicting \"datestyle\" specifications."); errhint("Perhaps you need a different \"datestyle\" setting."))); {"default_table_access_method", PGC_USERSET, CLIENT_CONN_STATEMENT, - NOT QUOTED GUC_check_errdetail("%s cannot be empty.", "default_table_access_method"); GUC_check_errdetail("%s is too long (maximum %d characters).", "default_table_access_method", NAMEDATALEN - 1); warn_or_exit_horribly(AH, "could not set default_table_access_method: %s", PQerrorMessage(AH->connection)); {"default_tablespace", PGC_USERSET, CLIENT_CONN_STATEMENT, - NOT QUOTED warn_or_exit_horribly(AH, "could not set default_tablespace to %s: %s", fmtId(want), PQerrorMessage(AH->connection)); {"temp_tablespaces", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"createrole_self_grant", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"dynamic_library_path", PGC_SUSET, CLIENT_CONN_OTHER, - QUOTED errmsg("zero-length component in parameter \"dynamic_library_path\""))); errmsg("component in parameter \"dynamic_library_path\" is not an absolute path"))); {"krb_server_keyfile", PGC_SIGHUP, CONN_AUTH_AUTH, - NONE {"bonjour_name", PGC_POSTMASTER, CONN_AUTH_SETTINGS, - NONE {"lc_messages", PGC_SUSET, CLIENT_CONN_LOCALE, - NOT QUOTED pg_fatal("failed to set lc_messages: %s", PQerrorMessage(conn)); {"lc_monetary", PGC_USERSET, CLIENT_CONN_LOCALE, - NONE {"lc_numeric", PGC_USERSET, CLIENT_CONN_LOCALE, - NONE {"lc_time", PGC_USERSET, CLIENT_CONN_LOCALE, - NONE {"session_preload_libraries", PGC_SUSET, CLIENT_CONN_PRELOAD, - NONE {"shared_preload_libraries", PGC_POSTMASTER, CLIENT_CONN_PRELOAD, - NOT QUOTED errmsg("pg_stat_statements must be loaded via shared_preload_libraries"))); errmsg("pg_stat_statements must be loaded via shared_preload_libraries"))); errmsg("pg_stat_statements must be loaded via shared_preload_libraries"))); errmsg("sepgsql must be loaded via shared_preload_libraries"))); errhint("Include the extension module that implements this resource manager in shared_preload_libraries."))); errdetail("Custom resource manager must be registered while initializing modules in shared_preload_libraries."))); errmsg("background worker \"%s\": must be registered in shared_preload_libraries", worker->bgw_name))); errdetail("\"%s\" must be loaded with shared_preload_libraries.", "test_slru"))) {"local_preload_libraries", PGC_USERSET, CLIENT_CONN_PRELOAD, - NONE {"search_path", PGC_USERSET, CLIENT_CONN_STATEMENT, - NOT QUOTED pg_log_error("could not clear search_path: %s", PQerrorMessage(conn)); pg_log_error("failed to set search_path: %s", PQerrorMessage(conn)); pg_log_error("could not clear search_path: %s", PQerrorMessage(tmpconn)); warn_or_exit_horribly(AH, "could not set search_path to \"%s\": %s", schemaName, PQerrorMessage(AH->connection)); pg_log_info("saving search_path = %s", path->data); pg_fatal("could not clear search_path: %s", PQresultErrorMessage(res)); pg_log_error("no pgbench_accounts table found in search_path"); {"server_encoding", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"server_version", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"role", PGC_USERSET, UNGROUPED, - NONE? {"session_authorization", PGC_USERSET, UNGROUPED, - NONE {"log_destination", PGC_SIGHUP, LOGGING_WHERE, - NONE {"log_directory", PGC_SIGHUP, LOGGING_WHERE, - NONE {"log_filename", PGC_SIGHUP, LOGGING_WHERE, - NOT QUOTED errmsg("the log_filename parameter must equal 'postgresql-%%Y-%%m-%%d_%%H%%M%%S.log'"))) {"syslog_ident", PGC_SIGHUP, LOGGING_WHERE, - NONE {"event_source", PGC_POSTMASTER, LOGGING_WHERE, - NONE {"TimeZone", PGC_USERSET, CLIENT_CONN_LOCALE, - NOT QUOTED, need to re-check are these really the GUC name elog(ERROR, "unrecognized timezone type %d", (int) tp->type); (errmsg_internal("timezone directory stack overflow"))); {"timezone_abbreviations", PGC_USERSET, CLIENT_CONN_LOCALE, - NONE {"unix_socket_group", PGC_POSTMASTER, CONN_AUTH_SETTINGS, - NOT QUOTED elog(WARNING, "configuration item unix_socket_group is not supported on this platform"); {"unix_socket_directories", PGC_POSTMASTER, CONN_AUTH_SETTINGS, - NONE {"listen_addresses", PGC_POSTMASTER, CONN_AUTH_SETTINGS, - NONE {"data_directory", PGC_POSTMASTER, FILE_LOCATIONS, - QUOTED write_stderr(... "This can be specified as \"data_directory\" in \"%s\", " ... {"config_file", PGC_POSTMASTER, FILE_LOCATIONS, - NONE {"hba_file", PGC_POSTMASTER, FILE_LOCATIONS, - QUOTED write_stderr(... "This can be specified as \"hba_file\" in \"%s\", "... {"ident_file", PGC_POSTMASTER, FILE_LOCATIONS, - QUOTED write_stderr(... "This can be specified as \"ident_file\" in \"%s\", "... {"external_pid_file", PGC_POSTMASTER, FILE_LOCATIONS, - NONE {"ssl_library", PGC_INTERNAL, PRESET_OPTIONS, - NONE {"ssl_cert_file", PGC_SIGHUP, CONN_AUTH_SSL, - NONE {"ssl_key_file", PGC_SIGHUP, CONN_AUTH_SSL, - NONE {"ssl_ca_file", PGC_SIGHUP, CONN_AUTH_SSL, - NONE {"ssl_crl_file", PGC_SIGHUP, CONN_AUTH_SSL, - NONE {"ssl_crl_dir", PGC_SIGHUP, CONN_AUTH_SSL, - NONE {"synchronous_standby_names", PGC_SIGHUP, REPLICATION_PRIMARY, - NOT QUOTED GUC_check_errdetail("synchronous_standby_names parser failed"); {"default_text_search_config", PGC_USERSET, CLIENT_CONN_LOCALE, - NONE {"ssl_ciphers", PGC_SIGHUP, CONN_AUTH_SSL, - NONE {"ssl_ecdh_curve", PGC_SIGHUP, CONN_AUTH_SSL, - NONE {"ssl_dh_params_file", PGC_SIGHUP, CONN_AUTH_SSL, - NONE {"ssl_passphrase_command", PGC_SIGHUP, CONN_AUTH_SSL, - NOT QUOTED gettext_noop("Controls whether ssl_passphrase_command is called during server reload."), (errmsg("ssl_passphrase_command setting ignored by ssl_passphrase_func module"))); {"application_name", PGC_USERSET, LOGGING_WHAT, - NONE {"cluster_name", PGC_POSTMASTER, PROCESS_TITLE, - NONE {"wal_consistency_checking", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"jit_provider", PGC_POSTMASTER, CLIENT_CONN_PRELOAD, - NONE {"backtrace_functions", PGC_SUSET, DEVELOPER_OPTIONS, - NONE {"debug_io_direct", PGC_POSTMASTER, DEVELOPER_OPTIONS, - NOT QUOTED GUC_check_errdetail("debug_io_direct is not supported on this platform.") GUC_check_errdetail("debug_io_direct is not supported for WAL because XLOG_BLCKSZ is too small"); GUC_check_errdetail("debug_io_direct is not supported for data because BLCKSZ is too small"); - QUOTED GUC_check_errdetail("invalid list syntax in parameter \"%s\"", "debug_io_direct"); ~~~ ------------------ ConfigureNamesEnum ------------------ {"backslash_quote", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS, - NONE {"bytea_output", PGC_USERSET, CLIENT_CONN_STATEMENT, - NOT QUOTED elog(ERROR, "unrecognized bytea_output setting: %d", {"client_min_messages", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"compute_query_id", PGC_SUSET, STATS_MONITORING, - NONE {"constraint_exclusion", PGC_USERSET, QUERY_TUNING_OTHER, - NONE {"default_toast_compression", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"default_transaction_isolation", PGC_USERSET, CLIENT_CONN_STATEMENT, - QUOTED errdetail("\"default_transaction_isolation\" is set to \"serializable\"."), {"transaction_isolation", PGC_USERSET, CLIENT_CONN_STATEMENT, - QUOTED errdetail("\"default_transaction_isolation\" is set to \"serializable\"."), {"IntervalStyle", PGC_USERSET, CLIENT_CONN_LOCALE, - NONE {"icu_validation_level", PGC_USERSET, CLIENT_CONN_LOCALE, - QUOTED errhint("To disable ICU locale validation, set the parameter \"%s\" to \"%s\".", "icu_validation_level", "disabled"))); errhint("To disable ICU locale validation, set the parameter \"%s\" to \"%s\".", "icu_validation_level", "disabled"))); {"log_error_verbosity", PGC_SUSET, LOGGING_WHAT, - NONE {"log_min_messages", PGC_SUSET, LOGGING_WHEN, - NONE {"log_min_error_statement", PGC_SUSET, LOGGING_WHEN, - NONE {"log_statement", PGC_SUSET, LOGGING_WHAT, - NONE {"syslog_facility", PGC_SIGHUP, LOGGING_WHERE, - NONE {"session_replication_role", PGC_SUSET, CLIENT_CONN_STATEMENT, - NONE {"synchronous_commit", PGC_USERSET, WAL_SETTINGS, - NONE {"archive_mode", PGC_POSTMASTER, WAL_ARCHIVING, - NOT QUOTED errmsg("archive_mode enabled, yet archiving is not configured"))); {"recovery_target_action", PGC_POSTMASTER, WAL_RECOVERY_TARGET, - NONE {"trace_recovery_messages", PGC_SIGHUP, DEVELOPER_OPTIONS, - NONE {"track_functions", PGC_SUSET, STATS_CUMULATIVE, - NONE {"stats_fetch_consistency", PGC_USERSET, STATS_CUMULATIVE, - NONE {"wal_compression", PGC_SUSET, WAL_SETTINGS, - NONE {"wal_level", PGC_POSTMASTER, WAL_SETTINGS, - NOT QUOTED, and notice some of these option values are quoted and some are not errmsg("WAL was generated with wal_level=minimal, cannot continue recovering") errdetail("This happens if you temporarily set wal_level=minimal on the server."), errhint("Use a backup taken after setting wal_level to higher than minimal."))); errhint("wal_level must be set to \"replica\" or \"logical\" at server start."))); errhint("wal_level must be set to \"replica\" or \"logical\" at server start."))); errmsg("pg_log_standby_snapshot() can only be used if wal_level >= replica"))); errhint("wal_level must be set to \"replica\" or \"logical\" at server start."))); errmsg("wal_level is insufficient to publish logical changes"), errhint("Set wal_level to \"logical\" before creating subscriptions."))); (errmsg("WAL archival cannot be enabled when wal_level is \"minimal\""))); (errmsg("WAL streaming (max_wal_senders > 0) requires wal_level \"replica\" or \"logical\""))); errmsg("replication slots can only be used if wal_level >= replica"))); appendStringInfo(&err_detail, _("Logical decoding on standby requires wal_level >= logical on the primary server.")); errmsg("logical replication slot \"%s\" exists, but wal_level < logical", errhint("Change wal_level to be logical or higher."))); errmsg("physical replication slot \"%s\" exists, but wal_level < replica", errhint("Change wal_level to be replica or higher."))); errmsg("physical replication slot \"%s\" exists, but wal_level < replica", errhint("Change wal_level to be replica or higher."))); errmsg("logical decoding on standby requires wal_level >= logical on the primary"))); errmsg("logical decoding requires wal_level >= logical"))); errmsg("logical decoding on standby requires wal_level >= logical on the primary"))); {"dynamic_shared_memory_type", PGC_POSTMASTER, RESOURCES_MEM, - NONE {"shared_memory_type", PGC_POSTMASTER, RESOURCES_MEM, - NOT QUOTED errmsg("huge pages not supported with the current shared_memory_type setting"))); {"wal_sync_method", PGC_SIGHUP, WAL_SETTINGS, - NOT QUOTED elog(ERROR, "unrecognized wal_sync_method: %d", method); elog(PANIC, "unrecognized wal_sync_method: %d", sync_method); {"xmlbinary", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"xmloption", PGC_USERSET, CLIENT_CONN_STATEMENT, - NONE {"huge_pages", PGC_POSTMASTER, RESOURCES_MEM, - NONE {"recovery_prefetch", PGC_SIGHUP, WAL_RECOVERY, - NOT QUOTED GUC_check_errdetail("recovery_prefetch is not supported on platforms that lack posix_fadvise()."); {"debug_parallel_query", PGC_USERSET, DEVELOPER_OPTIONS, - NONE {"password_encryption", PGC_USERSET, CONN_AUTH_AUTH, - NOT QUOTED libpq_append_conn_error(conn, "password_encryption value too long"); {"plan_cache_mode", PGC_USERSET, QUERY_TUNING_OTHER, - NONE {"ssl_min_protocol_version", PGC_SIGHUP, CONN_AUTH_SSL, - QUOTED (errmsg("\"%s\" setting \"%s\" not supported by this build", "ssl_min_protocol_version", GetConfigOption("ssl_min_protocol_version", false, false)))); - NOT QUOTED libpq_append_conn_error(conn, "invalid %s value: \"%s\"", "ssl_min_protocol_version", conn->ssl_min_protocol_version); {"ssl_max_protocol_version", PGC_SIGHUP, CONN_AUTH_SSL, - QUOTED (errmsg("\"%s\" setting \"%s\" not supported by this build", "ssl_max_protocol_version", GetConfigOption("ssl_max_protocol_version", false, false)))); errdetail("\"%s\" cannot be higher than \"%s\"", "ssl_min_protocol_version", "ssl_max_protocol_version"))); - NOT QUOTED libpq_append_conn_error(conn, "invalid %s value: \"%s\"", "ssl_max_protocol_version", conn->ssl_max_protocol_version); {"recovery_init_sync_method", PGC_SIGHUP, ERROR_HANDLING_OPTIONS, - NONE {"debug_logical_replication_streaming", PGC_USERSET, DEVELOPER_OPTIONS, - NONE [end] ^ permalink raw reply [nested|flat] 21+ messages in thread
* Re: GUC names in messages @ 2023-11-09 11:04 Alvaro Herrera <[email protected]> parent: Peter Smith <[email protected]> 0 siblings, 1 reply; 21+ messages in thread From: Alvaro Herrera @ 2023-11-09 11:04 UTC (permalink / raw) To: Peter Smith <[email protected]>; +Cc: Nathan Bossart <[email protected]>; Laurenz Albe <[email protected]>; Peter Eisentraut <[email protected]>; Tom Lane <[email protected]>; Daniel Gustafsson <[email protected]>; PostgreSQL Hackers <[email protected]> On 2023-Nov-09, Peter Smith wrote: > Notice that NOT QUOTED is the far more common pattern, so my vote > would be just to standardise on making everything this way. I know > there was some concern raised about ambiguous words like "timezone" > and "datestyle" etc but in practice, those are rare. Also, those GUCs > are different in that they are written as camel-case (e.g. > "DateStyle") in the guc_tables.c, so if they were also written > camel-case in the messages that could remove ambiguities with normal > words. YMMV. Well, I think camel-casing is also a sufficient differentiator for these identifiers not being English words. We'd need to ensure they're always written that way, when not quoted. However, in cases where arbitrary values are expanded, I don't know that they would be expanded that way, so I would still go for quoting in that case. There's also a few that are not camel-cased nor have any underscores -- looking at postgresql.conf.sample, we have "port", "bonjour", "ssl", "fsync", "geqo", "jit", "autovacuum", "xmlbinary", "xmloption". (We also have "include", but I doubt that's ever used in an error message). But actually, there's more: every reloption is a candidate, and there we have "fillfactor", "autosummarize", "fastupdate", "buffering". So if we want to make generic advice on how to deal with option names in error messages, I think the wording on conditional quoting I proposed should go in (adding CamelCase as a reason not to quote), and then we can fix the code to match. Looking at your list, I think the changes to make are not too numerous. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "Nadie está tan esclavizado como el que se cree libre no siéndolo" (Goethe) ^ permalink raw reply [nested|flat] 21+ messages in thread
* Re: GUC names in messages @ 2023-11-23 07:27 Peter Smith <[email protected]> parent: Alvaro Herrera <[email protected]> 0 siblings, 1 reply; 21+ messages in thread From: Peter Smith @ 2023-11-23 07:27 UTC (permalink / raw) To: Alvaro Herrera <[email protected]>; +Cc: Nathan Bossart <[email protected]>; Laurenz Albe <[email protected]>; Peter Eisentraut <[email protected]>; Tom Lane <[email protected]>; Daniel Gustafsson <[email protected]>; PostgreSQL Hackers <[email protected]> On Thu, Nov 9, 2023 at 10:04 PM Alvaro Herrera <[email protected]> wrote: > > On 2023-Nov-09, Peter Smith wrote: > > > Notice that NOT QUOTED is the far more common pattern, so my vote > > would be just to standardise on making everything this way. I know > > there was some concern raised about ambiguous words like "timezone" > > and "datestyle" etc but in practice, those are rare. Also, those GUCs > > are different in that they are written as camel-case (e.g. > > "DateStyle") in the guc_tables.c, so if they were also written > > camel-case in the messages that could remove ambiguities with normal > > words. YMMV. > > Well, I think camel-casing is also a sufficient differentiator for these > identifiers not being English words. We'd need to ensure they're always > written that way, when not quoted. However, in cases where arbitrary > values are expanded, I don't know that they would be expanded that way, > so I would still go for quoting in that case. > > There's also a few that are not camel-cased nor have any underscores -- > looking at postgresql.conf.sample, we have "port", "bonjour", "ssl", > "fsync", "geqo", "jit", "autovacuum", "xmlbinary", "xmloption". (We also > have "include", but I doubt that's ever used in an error message). But > actually, there's more: every reloption is a candidate, and there we > have "fillfactor", "autosummarize", "fastupdate", "buffering". So if we > want to make generic advice on how to deal with option names in error > messages, I think the wording on conditional quoting I proposed should > go in (adding CamelCase as a reason not to quote), and then we can fix > the code to match. Looking at your list, I think the changes to make > are not too numerous. > Sorry for my delay in getting back to this thread. PSA a patch for this work. There may be some changes I've missed, but hopefully, this is a nudge in the right direction. ====== Kind Regards, Peter Smith. Fujitsu Australia. Attachments: [application/octet-stream] v1-0001-GUC-names-docs.patch (1.1K, ../../CAHut+PsXEqjxdvR6sZX6ihgWhK8jwk=L7VJdAJJT+hwAVwwj7w@mail.gmail.com/2-v1-0001-GUC-names-docs.patch) download | inline diff: From d935519fa69d873a1b11340076910b31caad2a05 Mon Sep 17 00:00:00 2001 From: Peter Smith <[email protected]> Date: Thu, 23 Nov 2023 14:05:58 +1100 Subject: [PATCH v1] GUC names - docs --- doc/src/sgml/sources.sgml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml index 06d995e..45ad706 100644 --- a/doc/src/sgml/sources.sgml +++ b/doc/src/sgml/sources.sgml @@ -539,6 +539,14 @@ Hint: The addendum, written as a complete sentence. </para> <para> + In messages containing configuration variable names, do not include quotes + when the names are visibly not English natural words, such as when they + have underscores or are all-uppercase or have mixed case. Otherwise, quotes + must be added. Do include quotes in a message where an arbitrary variable + name is to be expanded. + </para> + + <para> There are functions in the backend that will double-quote their own output as needed (for example, <function>format_type_be()</function>). Do not put additional quotes around the output of such functions. -- 1.8.3.1 [application/octet-stream] v1-0002-GUC-names-fix-quotes.patch (28.6K, ../../CAHut+PsXEqjxdvR6sZX6ihgWhK8jwk=L7VJdAJJT+hwAVwwj7w@mail.gmail.com/3-v1-0002-GUC-names-fix-quotes.patch) download | inline diff: From fab191bb5564552a61e5f98dd05fc79ca724a1af Mon Sep 17 00:00:00 2001 From: Peter Smith <[email protected]> Date: Thu, 23 Nov 2023 18:21:47 +1100 Subject: [PATCH v1] GUC names - fix quotes --- src/backend/access/heap/vacuumlazy.c | 2 +- src/backend/access/transam/commit_ts.c | 4 +- src/backend/access/transam/xlog.c | 4 +- src/backend/commands/vacuum.c | 2 +- src/backend/commands/variable.c | 4 +- src/backend/libpq/be-secure-openssl.c | 6 +-- src/backend/postmaster/checkpointer.c | 2 +- src/backend/postmaster/pgarch.c | 2 +- src/backend/storage/buffer/localbuf.c | 2 +- src/backend/storage/file/fd.c | 2 +- src/backend/storage/lmgr/predicate.c | 2 +- src/backend/tcop/postgres.c | 10 ++--- src/backend/utils/adt/datetime.c | 2 +- src/backend/utils/adt/pg_locale.c | 4 +- src/backend/utils/fmgr/dfmgr.c | 4 +- src/backend/utils/misc/guc.c | 2 +- src/backend/utils/misc/guc_tables.c | 4 +- src/test/regress/expected/collate.icu.utf8.out | 4 +- src/test/regress/expected/date.out | 58 +++++++++++++------------- src/test/regress/expected/horology.out | 2 +- src/test/regress/expected/json.out | 4 +- src/test/regress/expected/jsonb.out | 4 +- 22 files changed, 65 insertions(+), 65 deletions(-) diff --git a/src/backend/access/heap/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c index 59f51f4..3b9299b 100644 --- a/src/backend/access/heap/vacuumlazy.c +++ b/src/backend/access/heap/vacuumlazy.c @@ -2658,7 +2658,7 @@ lazy_check_wraparound_failsafe(LVRelState *vacrel) vacrel->dbname, vacrel->relnamespace, vacrel->relname, vacrel->num_index_scans), errdetail("The table's relfrozenxid or relminmxid is too far in the past."), - errhint("Consider increasing configuration parameter \"maintenance_work_mem\" or \"autovacuum_work_mem\".\n" + errhint("Consider increasing configuration parameter maintenance_work_mem or autovacuum_work_mem.\n" "You might also need to consider other ways for VACUUM to keep up with the allocation of transaction IDs."))); /* Stop applying cost limits from this point on */ diff --git a/src/backend/access/transam/commit_ts.c b/src/backend/access/transam/commit_ts.c index b897fab..9385790 100644 --- a/src/backend/access/transam/commit_ts.c +++ b/src/backend/access/transam/commit_ts.c @@ -376,9 +376,9 @@ error_commit_ts_disabled(void) (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), errmsg("could not get commit timestamp data"), RecoveryInProgress() ? - errhint("Make sure the configuration parameter \"%s\" is set on the primary server.", + errhint("Make sure the configuration parameter %s is set on the primary server.", "track_commit_timestamp") : - errhint("Make sure the configuration parameter \"%s\" is set.", + errhint("Make sure the configuration parameter %s is set.", "track_commit_timestamp"))); } diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 1159dff..32adc63 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -4244,11 +4244,11 @@ ReadControlFile(void) /* check and update variables dependent on wal_segment_size */ if (ConvertToXSegs(min_wal_size_mb, wal_segment_size) < 2) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("\"min_wal_size\" must be at least twice \"wal_segment_size\""))); + errmsg("min_wal_size must be at least twice wal_segment_size"))); if (ConvertToXSegs(max_wal_size_mb, wal_segment_size) < 2) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("\"max_wal_size\" must be at least twice \"wal_segment_size\""))); + errmsg("max_wal_size must be at least twice wal_segment_size"))); UsableBytesInSegment = (wal_segment_size / XLOG_BLCKSZ * UsableBytesInPage) - diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index 8bdbee6..be43b46 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -134,7 +134,7 @@ check_vacuum_buffer_usage_limit(int *newval, void **extra, return true; /* Value does not fall within any allowable range */ - GUC_check_errdetail("\"vacuum_buffer_usage_limit\" must be 0 or between %d kB and %d kB", + GUC_check_errdetail("vacuum_buffer_usage_limit must be 0 or between %d kB and %d kB", MIN_BAS_VAC_RING_SIZE_KB, MAX_BAS_VAC_RING_SIZE_KB); return false; diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c index a88cf5f..2703d2e 100644 --- a/src/backend/commands/variable.c +++ b/src/backend/commands/variable.c @@ -182,7 +182,7 @@ check_datestyle(char **newval, void **extra, GucSource source) if (!ok) { - GUC_check_errdetail("Conflicting \"datestyle\" specifications."); + GUC_check_errdetail("Conflicting DateStyle specifications."); return false; } @@ -717,7 +717,7 @@ check_client_encoding(char **newval, void **extra, GucSource source) else { /* Provide a useful complaint */ - GUC_check_errdetail("Cannot change \"client_encoding\" now."); + GUC_check_errdetail("Cannot change client_encoding now."); } return false; } diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c index 31b6a6e..e715fee 100644 --- a/src/backend/libpq/be-secure-openssl.c +++ b/src/backend/libpq/be-secure-openssl.c @@ -195,7 +195,7 @@ be_tls_init(bool isServerStart) { ereport(isServerStart ? FATAL : LOG, /*- translator: first %s is a GUC option name, second %s is its value */ - (errmsg("\"%s\" setting \"%s\" not supported by this build", + (errmsg("%s setting \"%s\" not supported by this build", "ssl_min_protocol_version", GetConfigOption("ssl_min_protocol_version", false, false)))); @@ -218,7 +218,7 @@ be_tls_init(bool isServerStart) { ereport(isServerStart ? FATAL : LOG, /*- translator: first %s is a GUC option name, second %s is its value */ - (errmsg("\"%s\" setting \"%s\" not supported by this build", + (errmsg("%s setting \"%s\" not supported by this build", "ssl_max_protocol_version", GetConfigOption("ssl_max_protocol_version", false, false)))); @@ -245,7 +245,7 @@ be_tls_init(bool isServerStart) { ereport(isServerStart ? FATAL : LOG, (errmsg("could not set SSL protocol version range"), - errdetail("\"%s\" cannot be higher than \"%s\"", + errdetail("%s cannot be higher than %s", "ssl_min_protocol_version", "ssl_max_protocol_version"))); goto error; diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c index 42c807d..dc2da5a 100644 --- a/src/backend/postmaster/checkpointer.c +++ b/src/backend/postmaster/checkpointer.c @@ -423,7 +423,7 @@ CheckpointerMain(void) "checkpoints are occurring too frequently (%d seconds apart)", elapsed_secs, elapsed_secs), - errhint("Consider increasing the configuration parameter \"max_wal_size\"."))); + errhint("Consider increasing the configuration parameter max_wal_size."))); /* * Initialize checkpointer-private variables used during diff --git a/src/backend/postmaster/pgarch.c b/src/backend/postmaster/pgarch.c index 46af349..a2555e8 100644 --- a/src/backend/postmaster/pgarch.c +++ b/src/backend/postmaster/pgarch.c @@ -807,7 +807,7 @@ HandlePgArchInterrupts(void) */ ereport(LOG, (errmsg("restarting archiver process because value of " - "\"archive_library\" was changed"))); + "archive_library was changed"))); proc_exit(0); } diff --git a/src/backend/storage/buffer/localbuf.c b/src/backend/storage/buffer/localbuf.c index 4efb34b..aebcf14 100644 --- a/src/backend/storage/buffer/localbuf.c +++ b/src/backend/storage/buffer/localbuf.c @@ -705,7 +705,7 @@ check_temp_buffers(int *newval, void **extra, GucSource source) */ if (source != PGC_S_TEST && NLocBuffer && NLocBuffer != *newval) { - GUC_check_errdetail("\"temp_buffers\" cannot be changed after any temporary tables have been accessed in the session."); + GUC_check_errdetail("temp_buffers cannot be changed after any temporary tables have been accessed in the session."); return false; } return true; diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c index f691ba0..a185fb3 100644 --- a/src/backend/storage/file/fd.c +++ b/src/backend/storage/file/fd.c @@ -3931,7 +3931,7 @@ check_debug_io_direct(char **newval, void **extra, GucSource source) if (!SplitGUCList(rawstring, ',', &elemlist)) { - GUC_check_errdetail("invalid list syntax in parameter \"%s\"", + GUC_check_errdetail("invalid list syntax in parameter %s", "debug_io_direct"); pfree(rawstring); list_free(elemlist); diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c index a794546..f1f6d0c 100644 --- a/src/backend/storage/lmgr/predicate.c +++ b/src/backend/storage/lmgr/predicate.c @@ -1643,7 +1643,7 @@ GetSerializableTransactionSnapshot(Snapshot snapshot) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("cannot use serializable mode in a hot standby"), - errdetail("\"default_transaction_isolation\" is set to \"serializable\"."), + errdetail("default_transaction_isolation is set to \"serializable\"."), errhint("You can use \"SET default_transaction_isolation = 'repeatable read'\" to change the default."))); /* diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index e415cf1..7298a18 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -3524,7 +3524,7 @@ check_stack_depth(void) ereport(ERROR, (errcode(ERRCODE_STATEMENT_TOO_COMPLEX), errmsg("stack depth limit exceeded"), - errhint("Increase the configuration parameter \"max_stack_depth\" (currently %dkB), " + errhint("Increase the configuration parameter max_stack_depth (currently %dkB), " "after ensuring the platform's stack depth limit is adequate.", max_stack_depth))); } @@ -3571,7 +3571,7 @@ check_max_stack_depth(int *newval, void **extra, GucSource source) if (stack_rlimit > 0 && newval_bytes > stack_rlimit - STACK_DEPTH_SLOP) { - GUC_check_errdetail("\"max_stack_depth\" must not exceed %ldkB.", + GUC_check_errdetail("max_stack_depth must not exceed %ldkB.", (stack_rlimit - STACK_DEPTH_SLOP) / 1024L); GUC_check_errhint("Increase the platform's stack depth limit via \"ulimit -s\" or local equivalent."); return false; @@ -3632,9 +3632,9 @@ check_log_stats(bool *newval, void **extra, GucSource source) if (*newval && (log_parser_stats || log_planner_stats || log_executor_stats)) { - GUC_check_errdetail("Cannot enable \"log_statement_stats\" when " - "\"log_parser_stats\", \"log_planner_stats\", " - "or \"log_executor_stats\" is true."); + GUC_check_errdetail("Cannot enable log_statement_stats when " + "log_parser_stats, log_planner_stats, " + "or log_executor_stats is true."); return false; } return true; diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c index fca9a2a..8ef5bf0 100644 --- a/src/backend/utils/adt/datetime.c +++ b/src/backend/utils/adt/datetime.c @@ -4022,7 +4022,7 @@ DateTimeParseError(int dterr, DateTimeErrorExtra *extra, (errcode(ERRCODE_DATETIME_FIELD_OVERFLOW), errmsg("date/time field value out of range: \"%s\"", str), - errhint("Perhaps you need a different \"datestyle\" setting."))); + errhint("Perhaps you need a different DateStyle setting."))); break; case DTERR_INTERVAL_OVERFLOW: errsave(escontext, diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c index d5003da..1dee462 100644 --- a/src/backend/utils/adt/pg_locale.c +++ b/src/backend/utils/adt/pg_locale.c @@ -2875,7 +2875,7 @@ icu_validate_locale(const char *loc_str) ereport(elevel, (errmsg("could not get language from ICU locale \"%s\": %s", loc_str, u_errorName(status)), - errhint("To disable ICU locale validation, set the parameter \"%s\" to \"%s\".", + errhint("To disable ICU locale validation, set the parameter %s to \"%s\".", "icu_validation_level", "disabled"))); return; } @@ -2904,7 +2904,7 @@ icu_validate_locale(const char *loc_str) ereport(elevel, (errmsg("ICU locale \"%s\" has unknown language \"%s\"", loc_str, lang), - errhint("To disable ICU locale validation, set the parameter \"%s\" to \"%s\".", + errhint("To disable ICU locale validation, set the parameter %s to \"%s\".", "icu_validation_level", "disabled"))); /* check that it can be opened */ diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c index b85d52c..56724ff 100644 --- a/src/backend/utils/fmgr/dfmgr.c +++ b/src/backend/utils/fmgr/dfmgr.c @@ -555,7 +555,7 @@ find_in_dynamic_libpath(const char *basename) if (piece == p) ereport(ERROR, (errcode(ERRCODE_INVALID_NAME), - errmsg("zero-length component in parameter \"dynamic_library_path\""))); + errmsg("zero-length component in parameter dynamic_library_path"))); if (piece == NULL) len = strlen(p); @@ -574,7 +574,7 @@ find_in_dynamic_libpath(const char *basename) if (!is_absolute_path(mangled)) ereport(ERROR, (errcode(ERRCODE_INVALID_NAME), - errmsg("component in parameter \"dynamic_library_path\" is not an absolute path"))); + errmsg("component in parameter dynamic_library_path is not an absolute path"))); full = palloc(strlen(mangled) + 1 + baselen + 1); sprintf(full, "%s/%s", mangled, basename); diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 82d8efb..e76c083 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -1873,7 +1873,7 @@ SelectConfigFiles(const char *userDoption, const char *progname) else { write_stderr("%s does not know where to find the database system data.\n" - "This can be specified as \"data_directory\" in \"%s\", " + "This can be specified as data_directory in \"%s\", " "or by the -D invocation option, or by the " "PGDATA environment variable.\n", progname, ConfigFileName); diff --git a/src/backend/utils/misc/guc_tables.c b/src/backend/utils/misc/guc_tables.c index b764ef6..67fedb2 100644 --- a/src/backend/utils/misc/guc_tables.c +++ b/src/backend/utils/misc/guc_tables.c @@ -3811,7 +3811,7 @@ struct config_string ConfigureNamesString[] = { {"archive_command", PGC_SIGHUP, WAL_ARCHIVING, gettext_noop("Sets the shell command that will be called to archive a WAL file."), - gettext_noop("This is used only if \"archive_library\" is not set.") + gettext_noop("This is used only if archive_library is not set.") }, &XLogArchiveCommand, "", @@ -3821,7 +3821,7 @@ struct config_string ConfigureNamesString[] = { {"archive_library", PGC_SIGHUP, WAL_ARCHIVING, gettext_noop("Sets the library that will be called to archive a WAL file."), - gettext_noop("An empty string indicates that \"archive_command\" should be used.") + gettext_noop("An empty string indicates that archive_command should be used.") }, &XLogArchiveLibrary, "", diff --git a/src/test/regress/expected/collate.icu.utf8.out b/src/test/regress/expected/collate.icu.utf8.out index 97bbe53..7a05c75 100644 --- a/src/test/regress/expected/collate.icu.utf8.out +++ b/src/test/regress/expected/collate.icu.utf8.out @@ -1042,7 +1042,7 @@ ERROR: parameter "locale" must be specified SET icu_validation_level = ERROR; CREATE COLLATION testx (provider = icu, locale = 'nonsense-nowhere'); -- fails ERROR: ICU locale "nonsense-nowhere" has unknown language "nonsense" -HINT: To disable ICU locale validation, set the parameter "icu_validation_level" to "disabled". +HINT: To disable ICU locale validation, set the parameter icu_validation_level to "disabled". CREATE COLLATION testx (provider = icu, locale = '@colStrength=primary;nonsense=yes'); -- fails ERROR: could not convert locale name "@colStrength=primary;nonsense=yes" to language tag: U_ILLEGAL_ARGUMENT_ERROR RESET icu_validation_level; @@ -1050,7 +1050,7 @@ CREATE COLLATION testx (provider = icu, locale = '@colStrength=primary;nonsense= WARNING: could not convert locale name "@colStrength=primary;nonsense=yes" to language tag: U_ILLEGAL_ARGUMENT_ERROR CREATE COLLATION testx (provider = icu, locale = 'nonsense-nowhere'); DROP COLLATION testx; WARNING: ICU locale "nonsense-nowhere" has unknown language "nonsense" -HINT: To disable ICU locale validation, set the parameter "icu_validation_level" to "disabled". +HINT: To disable ICU locale validation, set the parameter icu_validation_level to "disabled". CREATE COLLATION test4 FROM nonsense; ERROR: collation "nonsense" for encoding "UTF8" does not exist CREATE COLLATION test5 FROM test0; diff --git a/src/test/regress/expected/date.out b/src/test/regress/expected/date.out index f5949f3..99650bf 100644 --- a/src/test/regress/expected/date.out +++ b/src/test/regress/expected/date.out @@ -94,17 +94,17 @@ SELECT date '1/8/1999'; ERROR: date/time field value out of range: "1/8/1999" LINE 1: SELECT date '1/8/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1/18/1999'; ERROR: date/time field value out of range: "1/18/1999" LINE 1: SELECT date '1/18/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '18/1/1999'; ERROR: date/time field value out of range: "18/1/1999" LINE 1: SELECT date '18/1/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01/02/03'; date ------------ @@ -139,7 +139,7 @@ SELECT date 'January 8, 99 BC'; ERROR: date/time field value out of range: "January 8, 99 BC" LINE 1: SELECT date 'January 8, 99 BC'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '99-Jan-08'; date ------------ @@ -156,7 +156,7 @@ SELECT date '08-Jan-99'; ERROR: date/time field value out of range: "08-Jan-99" LINE 1: SELECT date '08-Jan-99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '08-Jan-1999'; date ------------ @@ -167,7 +167,7 @@ SELECT date 'Jan-08-99'; ERROR: date/time field value out of range: "Jan-08-99" LINE 1: SELECT date 'Jan-08-99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date 'Jan-08-1999'; date ------------ @@ -198,7 +198,7 @@ SELECT date '08 Jan 99'; ERROR: date/time field value out of range: "08 Jan 99" LINE 1: SELECT date '08 Jan 99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '08 Jan 1999'; date ------------ @@ -209,7 +209,7 @@ SELECT date 'Jan 08 99'; ERROR: date/time field value out of range: "Jan 08 99" LINE 1: SELECT date 'Jan 08 99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date 'Jan 08 1999'; date ------------ @@ -244,22 +244,22 @@ SELECT date '08-01-99'; ERROR: date/time field value out of range: "08-01-99" LINE 1: SELECT date '08-01-99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '08-01-1999'; ERROR: date/time field value out of range: "08-01-1999" LINE 1: SELECT date '08-01-1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01-08-99'; ERROR: date/time field value out of range: "01-08-99" LINE 1: SELECT date '01-08-99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01-08-1999'; ERROR: date/time field value out of range: "01-08-1999" LINE 1: SELECT date '01-08-1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '99-08-01'; date ------------ @@ -288,22 +288,22 @@ SELECT date '08 01 99'; ERROR: date/time field value out of range: "08 01 99" LINE 1: SELECT date '08 01 99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '08 01 1999'; ERROR: date/time field value out of range: "08 01 1999" LINE 1: SELECT date '08 01 1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01 08 99'; ERROR: date/time field value out of range: "01 08 99" LINE 1: SELECT date '01 08 99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01 08 1999'; ERROR: date/time field value out of range: "01 08 1999" LINE 1: SELECT date '01 08 1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '99 08 01'; date ------------ @@ -345,7 +345,7 @@ SELECT date '1/18/1999'; ERROR: date/time field value out of range: "1/18/1999" LINE 1: SELECT date '1/18/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '18/1/1999'; date ------------ @@ -392,7 +392,7 @@ SELECT date '99-Jan-08'; ERROR: date/time field value out of range: "99-Jan-08" LINE 1: SELECT date '99-Jan-08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-Jan-08'; date ------------ @@ -435,7 +435,7 @@ SELECT date '99 Jan 08'; ERROR: date/time field value out of range: "99 Jan 08" LINE 1: SELECT date '99 Jan 08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 Jan 08'; date ------------ @@ -480,7 +480,7 @@ SELECT date '99-01-08'; ERROR: date/time field value out of range: "99-01-08" LINE 1: SELECT date '99-01-08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-01-08'; date ------------ @@ -515,7 +515,7 @@ SELECT date '99-08-01'; ERROR: date/time field value out of range: "99-08-01" LINE 1: SELECT date '99-08-01'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-08-01'; date ------------ @@ -526,7 +526,7 @@ SELECT date '99 01 08'; ERROR: date/time field value out of range: "99 01 08" LINE 1: SELECT date '99 01 08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 01 08'; date ------------ @@ -561,7 +561,7 @@ SELECT date '99 08 01'; ERROR: date/time field value out of range: "99 08 01" LINE 1: SELECT date '99 08 01'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 08 01'; date ------------ @@ -603,7 +603,7 @@ SELECT date '18/1/1999'; ERROR: date/time field value out of range: "18/1/1999" LINE 1: SELECT date '18/1/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01/02/03'; date ------------ @@ -644,7 +644,7 @@ SELECT date '99-Jan-08'; ERROR: date/time field value out of range: "99-Jan-08" LINE 1: SELECT date '99-Jan-08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-Jan-08'; date ------------ @@ -731,7 +731,7 @@ SELECT date '99-01-08'; ERROR: date/time field value out of range: "99-01-08" LINE 1: SELECT date '99-01-08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-01-08'; date ------------ @@ -766,7 +766,7 @@ SELECT date '99-08-01'; ERROR: date/time field value out of range: "99-08-01" LINE 1: SELECT date '99-08-01'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-08-01'; date ------------ @@ -777,7 +777,7 @@ SELECT date '99 01 08'; ERROR: date/time field value out of range: "99 01 08" LINE 1: SELECT date '99 01 08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 01 08'; date ------------ @@ -812,7 +812,7 @@ SELECT date '99 08 01'; ERROR: date/time field value out of range: "99 08 01" LINE 1: SELECT date '99 08 01'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 08 01'; date ------------ diff --git a/src/test/regress/expected/horology.out b/src/test/regress/expected/horology.out index cfb4b20..4aeefd5 100644 --- a/src/test/regress/expected/horology.out +++ b/src/test/regress/expected/horology.out @@ -100,7 +100,7 @@ SELECT timestamp with time zone '27/12/2001 04:05:06.789-08'; ERROR: date/time field value out of range: "27/12/2001 04:05:06.789-08" LINE 1: SELECT timestamp with time zone '27/12/2001 04:05:06.789-08'... ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. set datestyle to dmy; SELECT timestamp with time zone '27/12/2001 04:05:06.789-08'; timestamptz diff --git a/src/test/regress/expected/json.out b/src/test/regress/expected/json.out index aa29bc5..7cb28f1 100644 --- a/src/test/regress/expected/json.out +++ b/src/test/regress/expected/json.out @@ -219,10 +219,10 @@ CONTEXT: JSON data, line 1: {"abc":1,3... SET max_stack_depth = '100kB'; SELECT repeat('[', 10000)::json; ERROR: stack depth limit exceeded -HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate. +HINT: Increase the configuration parameter max_stack_depth (currently 100kB), after ensuring the platform's stack depth limit is adequate. SELECT repeat('{"a":', 10000)::json; ERROR: stack depth limit exceeded -HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate. +HINT: Increase the configuration parameter max_stack_depth (currently 100kB), after ensuring the platform's stack depth limit is adequate. RESET max_stack_depth; -- Miscellaneous stuff. SELECT 'true'::json; -- OK diff --git a/src/test/regress/expected/jsonb.out b/src/test/regress/expected/jsonb.out index f8a7dac..b597d01 100644 --- a/src/test/regress/expected/jsonb.out +++ b/src/test/regress/expected/jsonb.out @@ -213,10 +213,10 @@ CONTEXT: JSON data, line 1: {"abc":1,3... SET max_stack_depth = '100kB'; SELECT repeat('[', 10000)::jsonb; ERROR: stack depth limit exceeded -HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate. +HINT: Increase the configuration parameter max_stack_depth (currently 100kB), after ensuring the platform's stack depth limit is adequate. SELECT repeat('{"a":', 10000)::jsonb; ERROR: stack depth limit exceeded -HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate. +HINT: Increase the configuration parameter max_stack_depth (currently 100kB), after ensuring the platform's stack depth limit is adequate. RESET max_stack_depth; -- Miscellaneous stuff. SELECT 'true'::jsonb; -- OK -- 1.8.3.1 ^ permalink raw reply [nested|flat] 21+ messages in thread
* Re: GUC names in messages @ 2023-11-24 03:11 Michael Paquier <[email protected]> parent: Peter Smith <[email protected]> 0 siblings, 2 replies; 21+ messages in thread From: Michael Paquier @ 2023-11-24 03:11 UTC (permalink / raw) To: Peter Smith <[email protected]>; +Cc: Alvaro Herrera <[email protected]>; Nathan Bossart <[email protected]>; Laurenz Albe <[email protected]>; Peter Eisentraut <[email protected]>; Tom Lane <[email protected]>; Daniel Gustafsson <[email protected]>; PostgreSQL Hackers <[email protected]> On Thu, Nov 23, 2023 at 06:27:04PM +1100, Peter Smith wrote: > There may be some changes I've missed, but hopefully, this is a nudge > in the right direction. Thanks for spending some time on that. <para> + In messages containing configuration variable names, do not include quotes + when the names are visibly not English natural words, such as when they + have underscores or are all-uppercase or have mixed case. Otherwise, quotes + must be added. Do include quotes in a message where an arbitrary variable + name is to be expanded. + </para> That seems to describe clearly the consensus reached on the thread (quotes for GUCs that are single terms, no quotes for names that are obviously parameters). In terms of messages that have predictible names, 0002 moves in the needle in the right direction. There seem to be more: src/backend/postmaster/bgworker.c: errhint("Consider increasing the configuration parameter \"max_worker_processes\"."))); contrib/pg_prewarm/autoprewarm.c: errhint("Consider increasing configuration parameter \"max_worker_processes\"."))); Things like parse_and_validate_value() and set_config_option_ext() include log strings about GUC and these use quotes. Could these areas be made smarter with a routine to check if quotes are applied automatically when we have a "simple" GUC name, aka I guess made of only lower-case characters? This could be done with a islower() on the string name, for instance. -- Michael Attachments: [application/pgp-signature] signature.asc (833B, ../../[email protected]/2-signature.asc) download ^ permalink raw reply [nested|flat] 21+ messages in thread
* Re: GUC names in messages @ 2023-11-24 09:53 Alvaro Herrera <[email protected]> parent: Michael Paquier <[email protected]> 1 sibling, 1 reply; 21+ messages in thread From: Alvaro Herrera @ 2023-11-24 09:53 UTC (permalink / raw) To: Michael Paquier <[email protected]>; +Cc: Peter Smith <[email protected]>; Nathan Bossart <[email protected]>; Laurenz Albe <[email protected]>; Peter Eisentraut <[email protected]>; Tom Lane <[email protected]>; Daniel Gustafsson <[email protected]>; PostgreSQL Hackers <[email protected]> On 2023-Nov-24, Michael Paquier wrote: > On Thu, Nov 23, 2023 at 06:27:04PM +1100, Peter Smith wrote: > > There may be some changes I've missed, but hopefully, this is a nudge > > in the right direction. > > Thanks for spending some time on that. +1 > <para> > + In messages containing configuration variable names, do not include quotes > + when the names are visibly not English natural words, such as when they > + have underscores or are all-uppercase or have mixed case. Otherwise, quotes > + must be added. Do include quotes in a message where an arbitrary variable > + name is to be expanded. > + </para> > > That seems to describe clearly the consensus reached on the thread > (quotes for GUCs that are single terms, no quotes for names that are > obviously parameters). Yeah, this is pretty much the patch I proposed earlier. > In terms of messages that have predictible names, 0002 moves in the > needle in the right direction. There seem to be more: > src/backend/postmaster/bgworker.c: errhint("Consider increasing the > configuration parameter \"max_worker_processes\"."))); > contrib/pg_prewarm/autoprewarm.c: errhint("Consider increasing > configuration parameter \"max_worker_processes\"."))); Yeah. Also, these could be changed to have the GUC name outside the message proper, which would reduce the total number of messages. (But care must be given to the word "the" there.) > Things like parse_and_validate_value() and set_config_option_ext() > include log strings about GUC and these use quotes. Could these areas > be made smarter with a routine to check if quotes are applied > automatically when we have a "simple" GUC name, aka I guess made of > only lower-case characters? This could be done with a islower() on > the string name, for instance. I think we could leave these improvements for a second round. They don't need to hold back the improvement we already have. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "You're _really_ hosed if the person doing the hiring doesn't understand relational systems: you end up with a whole raft of programmers, none of whom has had a Date with the clue stick." (Andrew Sullivan) https://postgr.es/m/[email protected] ^ permalink raw reply [nested|flat] 21+ messages in thread
* Re: GUC names in messages @ 2023-11-24 14:01 Michael Paquier <[email protected]> parent: Alvaro Herrera <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Michael Paquier @ 2023-11-24 14:01 UTC (permalink / raw) To: Alvaro Herrera <[email protected]>; +Cc: Peter Smith <[email protected]>; Nathan Bossart <[email protected]>; Laurenz Albe <[email protected]>; Peter Eisentraut <[email protected]>; Tom Lane <[email protected]>; Daniel Gustafsson <[email protected]>; PostgreSQL Hackers <[email protected]> On Fri, Nov 24, 2023 at 10:53:40AM +0100, Alvaro Herrera wrote: > I think we could leave these improvements for a second round. They > don't need to hold back the improvement we already have. Of course, no problem here to do things one step at a time. -- Michael Attachments: [application/pgp-signature] signature.asc (833B, ../../[email protected]/2-signature.asc) download ^ permalink raw reply [nested|flat] 21+ messages in thread
* Re: GUC names in messages @ 2023-11-26 22:41 Peter Smith <[email protected]> parent: Michael Paquier <[email protected]> 1 sibling, 1 reply; 21+ messages in thread From: Peter Smith @ 2023-11-26 22:41 UTC (permalink / raw) To: Michael Paquier <[email protected]>; +Cc: Alvaro Herrera <[email protected]>; Nathan Bossart <[email protected]>; Laurenz Albe <[email protected]>; Peter Eisentraut <[email protected]>; Tom Lane <[email protected]>; Daniel Gustafsson <[email protected]>; PostgreSQL Hackers <[email protected]> On Fri, Nov 24, 2023 at 2:11 PM Michael Paquier <[email protected]> wrote: > > On Thu, Nov 23, 2023 at 06:27:04PM +1100, Peter Smith wrote: > > There may be some changes I've missed, but hopefully, this is a nudge > > in the right direction. > > Thanks for spending some time on that. > > <para> > + In messages containing configuration variable names, do not include quotes > + when the names are visibly not English natural words, such as when they > + have underscores or are all-uppercase or have mixed case. Otherwise, quotes > + must be added. Do include quotes in a message where an arbitrary variable > + name is to be expanded. > + </para> > > That seems to describe clearly the consensus reached on the thread > (quotes for GUCs that are single terms, no quotes for names that are > obviously parameters). > > In terms of messages that have predictible names, 0002 moves in the > needle in the right direction. There seem to be more: > src/backend/postmaster/bgworker.c: errhint("Consider increasing the > configuration parameter \"max_worker_processes\"."))); > contrib/pg_prewarm/autoprewarm.c: errhint("Consider increasing > configuration parameter \"max_worker_processes\"."))); Done in patch 0002 > > Things like parse_and_validate_value() and set_config_option_ext() > include log strings about GUC and these use quotes. Could these areas > be made smarter with a routine to check if quotes are applied > automatically when we have a "simple" GUC name, aka I guess made of > only lower-case characters? This could be done with a islower() on > the string name, for instance. See what you think of patch 0003 ~~ PSA v2 patches. ====== Kind Regards, Peter Smith. Fujitsu Australia Attachments: [application/octet-stream] v2-0001-GUC-names-docs.patch (1.1K, ../../CAHut+PtOqRPyVuX=xL=EhDAEWkpBh2MgeSW1KoyMjru-tEWO9w@mail.gmail.com/2-v2-0001-GUC-names-docs.patch) download | inline diff: From 4dbee6f4f6a23239c457e1484263b9822dbc13d7 Mon Sep 17 00:00:00 2001 From: Peter Smith <[email protected]> Date: Fri, 24 Nov 2023 17:16:53 +1100 Subject: [PATCH v2] GUC names - docs --- doc/src/sgml/sources.sgml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml index 06d995e..45ad706 100644 --- a/doc/src/sgml/sources.sgml +++ b/doc/src/sgml/sources.sgml @@ -539,6 +539,14 @@ Hint: The addendum, written as a complete sentence. </para> <para> + In messages containing configuration variable names, do not include quotes + when the names are visibly not English natural words, such as when they + have underscores or are all-uppercase or have mixed case. Otherwise, quotes + must be added. Do include quotes in a message where an arbitrary variable + name is to be expanded. + </para> + + <para> There are functions in the backend that will double-quote their own output as needed (for example, <function>format_type_be()</function>). Do not put additional quotes around the output of such functions. -- 1.8.3.1 [application/octet-stream] v2-0002-GUC-names-fix-quotes.patch (29.9K, ../../CAHut+PtOqRPyVuX=xL=EhDAEWkpBh2MgeSW1KoyMjru-tEWO9w@mail.gmail.com/3-v2-0002-GUC-names-fix-quotes.patch) download | inline diff: From b7816d510b59262c8ad5626447340654760d581a Mon Sep 17 00:00:00 2001 From: Peter Smith <[email protected]> Date: Mon, 27 Nov 2023 09:27:05 +1100 Subject: [PATCH v2] GUC names - fix quotes --- contrib/pg_prewarm/autoprewarm.c | 2 +- src/backend/access/heap/vacuumlazy.c | 2 +- src/backend/access/transam/commit_ts.c | 4 +- src/backend/access/transam/xlog.c | 4 +- src/backend/commands/vacuum.c | 2 +- src/backend/commands/variable.c | 4 +- src/backend/libpq/be-secure-openssl.c | 6 +-- src/backend/postmaster/bgworker.c | 2 +- src/backend/postmaster/checkpointer.c | 2 +- src/backend/postmaster/pgarch.c | 2 +- src/backend/storage/buffer/localbuf.c | 2 +- src/backend/storage/file/fd.c | 2 +- src/backend/storage/lmgr/predicate.c | 2 +- src/backend/tcop/postgres.c | 10 ++--- src/backend/utils/adt/datetime.c | 2 +- src/backend/utils/adt/pg_locale.c | 4 +- src/backend/utils/fmgr/dfmgr.c | 4 +- src/backend/utils/misc/guc.c | 2 +- src/backend/utils/misc/guc_tables.c | 4 +- src/test/regress/expected/collate.icu.utf8.out | 4 +- src/test/regress/expected/date.out | 58 +++++++++++++------------- src/test/regress/expected/horology.out | 2 +- src/test/regress/expected/json.out | 4 +- src/test/regress/expected/jsonb.out | 4 +- 24 files changed, 67 insertions(+), 67 deletions(-) diff --git a/contrib/pg_prewarm/autoprewarm.c b/contrib/pg_prewarm/autoprewarm.c index d0efc9e..0993bd2 100644 --- a/contrib/pg_prewarm/autoprewarm.c +++ b/contrib/pg_prewarm/autoprewarm.c @@ -877,7 +877,7 @@ apw_start_database_worker(void) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_RESOURCES), errmsg("registering dynamic bgworker autoprewarm failed"), - errhint("Consider increasing configuration parameter \"max_worker_processes\"."))); + errhint("Consider increasing configuration parameter max_worker_processes."))); /* * Ignore return value; if it fails, postmaster has died, but we have diff --git a/src/backend/access/heap/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c index 59f51f4..3b9299b 100644 --- a/src/backend/access/heap/vacuumlazy.c +++ b/src/backend/access/heap/vacuumlazy.c @@ -2658,7 +2658,7 @@ lazy_check_wraparound_failsafe(LVRelState *vacrel) vacrel->dbname, vacrel->relnamespace, vacrel->relname, vacrel->num_index_scans), errdetail("The table's relfrozenxid or relminmxid is too far in the past."), - errhint("Consider increasing configuration parameter \"maintenance_work_mem\" or \"autovacuum_work_mem\".\n" + errhint("Consider increasing configuration parameter maintenance_work_mem or autovacuum_work_mem.\n" "You might also need to consider other ways for VACUUM to keep up with the allocation of transaction IDs."))); /* Stop applying cost limits from this point on */ diff --git a/src/backend/access/transam/commit_ts.c b/src/backend/access/transam/commit_ts.c index b897fab..9385790 100644 --- a/src/backend/access/transam/commit_ts.c +++ b/src/backend/access/transam/commit_ts.c @@ -376,9 +376,9 @@ error_commit_ts_disabled(void) (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), errmsg("could not get commit timestamp data"), RecoveryInProgress() ? - errhint("Make sure the configuration parameter \"%s\" is set on the primary server.", + errhint("Make sure the configuration parameter %s is set on the primary server.", "track_commit_timestamp") : - errhint("Make sure the configuration parameter \"%s\" is set.", + errhint("Make sure the configuration parameter %s is set.", "track_commit_timestamp"))); } diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 1159dff..32adc63 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -4244,11 +4244,11 @@ ReadControlFile(void) /* check and update variables dependent on wal_segment_size */ if (ConvertToXSegs(min_wal_size_mb, wal_segment_size) < 2) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("\"min_wal_size\" must be at least twice \"wal_segment_size\""))); + errmsg("min_wal_size must be at least twice wal_segment_size"))); if (ConvertToXSegs(max_wal_size_mb, wal_segment_size) < 2) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("\"max_wal_size\" must be at least twice \"wal_segment_size\""))); + errmsg("max_wal_size must be at least twice wal_segment_size"))); UsableBytesInSegment = (wal_segment_size / XLOG_BLCKSZ * UsableBytesInPage) - diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index 8bdbee6..be43b46 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -134,7 +134,7 @@ check_vacuum_buffer_usage_limit(int *newval, void **extra, return true; /* Value does not fall within any allowable range */ - GUC_check_errdetail("\"vacuum_buffer_usage_limit\" must be 0 or between %d kB and %d kB", + GUC_check_errdetail("vacuum_buffer_usage_limit must be 0 or between %d kB and %d kB", MIN_BAS_VAC_RING_SIZE_KB, MAX_BAS_VAC_RING_SIZE_KB); return false; diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c index a88cf5f..2703d2e 100644 --- a/src/backend/commands/variable.c +++ b/src/backend/commands/variable.c @@ -182,7 +182,7 @@ check_datestyle(char **newval, void **extra, GucSource source) if (!ok) { - GUC_check_errdetail("Conflicting \"datestyle\" specifications."); + GUC_check_errdetail("Conflicting DateStyle specifications."); return false; } @@ -717,7 +717,7 @@ check_client_encoding(char **newval, void **extra, GucSource source) else { /* Provide a useful complaint */ - GUC_check_errdetail("Cannot change \"client_encoding\" now."); + GUC_check_errdetail("Cannot change client_encoding now."); } return false; } diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c index 31b6a6e..e715fee 100644 --- a/src/backend/libpq/be-secure-openssl.c +++ b/src/backend/libpq/be-secure-openssl.c @@ -195,7 +195,7 @@ be_tls_init(bool isServerStart) { ereport(isServerStart ? FATAL : LOG, /*- translator: first %s is a GUC option name, second %s is its value */ - (errmsg("\"%s\" setting \"%s\" not supported by this build", + (errmsg("%s setting \"%s\" not supported by this build", "ssl_min_protocol_version", GetConfigOption("ssl_min_protocol_version", false, false)))); @@ -218,7 +218,7 @@ be_tls_init(bool isServerStart) { ereport(isServerStart ? FATAL : LOG, /*- translator: first %s is a GUC option name, second %s is its value */ - (errmsg("\"%s\" setting \"%s\" not supported by this build", + (errmsg("%s setting \"%s\" not supported by this build", "ssl_max_protocol_version", GetConfigOption("ssl_max_protocol_version", false, false)))); @@ -245,7 +245,7 @@ be_tls_init(bool isServerStart) { ereport(isServerStart ? FATAL : LOG, (errmsg("could not set SSL protocol version range"), - errdetail("\"%s\" cannot be higher than \"%s\"", + errdetail("%s cannot be higher than %s", "ssl_min_protocol_version", "ssl_max_protocol_version"))); goto error; diff --git a/src/backend/postmaster/bgworker.c b/src/backend/postmaster/bgworker.c index 48a9924..911bf24 100644 --- a/src/backend/postmaster/bgworker.c +++ b/src/backend/postmaster/bgworker.c @@ -944,7 +944,7 @@ RegisterBackgroundWorker(BackgroundWorker *worker) "Up to %d background workers can be registered with the current settings.", max_worker_processes, max_worker_processes), - errhint("Consider increasing the configuration parameter \"max_worker_processes\"."))); + errhint("Consider increasing the configuration parameter max_worker_processes."))); return; } diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c index 42c807d..dc2da5a 100644 --- a/src/backend/postmaster/checkpointer.c +++ b/src/backend/postmaster/checkpointer.c @@ -423,7 +423,7 @@ CheckpointerMain(void) "checkpoints are occurring too frequently (%d seconds apart)", elapsed_secs, elapsed_secs), - errhint("Consider increasing the configuration parameter \"max_wal_size\"."))); + errhint("Consider increasing the configuration parameter max_wal_size."))); /* * Initialize checkpointer-private variables used during diff --git a/src/backend/postmaster/pgarch.c b/src/backend/postmaster/pgarch.c index 46af349..a2555e8 100644 --- a/src/backend/postmaster/pgarch.c +++ b/src/backend/postmaster/pgarch.c @@ -807,7 +807,7 @@ HandlePgArchInterrupts(void) */ ereport(LOG, (errmsg("restarting archiver process because value of " - "\"archive_library\" was changed"))); + "archive_library was changed"))); proc_exit(0); } diff --git a/src/backend/storage/buffer/localbuf.c b/src/backend/storage/buffer/localbuf.c index 4efb34b..aebcf14 100644 --- a/src/backend/storage/buffer/localbuf.c +++ b/src/backend/storage/buffer/localbuf.c @@ -705,7 +705,7 @@ check_temp_buffers(int *newval, void **extra, GucSource source) */ if (source != PGC_S_TEST && NLocBuffer && NLocBuffer != *newval) { - GUC_check_errdetail("\"temp_buffers\" cannot be changed after any temporary tables have been accessed in the session."); + GUC_check_errdetail("temp_buffers cannot be changed after any temporary tables have been accessed in the session."); return false; } return true; diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c index f691ba0..a185fb3 100644 --- a/src/backend/storage/file/fd.c +++ b/src/backend/storage/file/fd.c @@ -3931,7 +3931,7 @@ check_debug_io_direct(char **newval, void **extra, GucSource source) if (!SplitGUCList(rawstring, ',', &elemlist)) { - GUC_check_errdetail("invalid list syntax in parameter \"%s\"", + GUC_check_errdetail("invalid list syntax in parameter %s", "debug_io_direct"); pfree(rawstring); list_free(elemlist); diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c index a794546..f1f6d0c 100644 --- a/src/backend/storage/lmgr/predicate.c +++ b/src/backend/storage/lmgr/predicate.c @@ -1643,7 +1643,7 @@ GetSerializableTransactionSnapshot(Snapshot snapshot) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("cannot use serializable mode in a hot standby"), - errdetail("\"default_transaction_isolation\" is set to \"serializable\"."), + errdetail("default_transaction_isolation is set to \"serializable\"."), errhint("You can use \"SET default_transaction_isolation = 'repeatable read'\" to change the default."))); /* diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index e415cf1..7298a18 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -3524,7 +3524,7 @@ check_stack_depth(void) ereport(ERROR, (errcode(ERRCODE_STATEMENT_TOO_COMPLEX), errmsg("stack depth limit exceeded"), - errhint("Increase the configuration parameter \"max_stack_depth\" (currently %dkB), " + errhint("Increase the configuration parameter max_stack_depth (currently %dkB), " "after ensuring the platform's stack depth limit is adequate.", max_stack_depth))); } @@ -3571,7 +3571,7 @@ check_max_stack_depth(int *newval, void **extra, GucSource source) if (stack_rlimit > 0 && newval_bytes > stack_rlimit - STACK_DEPTH_SLOP) { - GUC_check_errdetail("\"max_stack_depth\" must not exceed %ldkB.", + GUC_check_errdetail("max_stack_depth must not exceed %ldkB.", (stack_rlimit - STACK_DEPTH_SLOP) / 1024L); GUC_check_errhint("Increase the platform's stack depth limit via \"ulimit -s\" or local equivalent."); return false; @@ -3632,9 +3632,9 @@ check_log_stats(bool *newval, void **extra, GucSource source) if (*newval && (log_parser_stats || log_planner_stats || log_executor_stats)) { - GUC_check_errdetail("Cannot enable \"log_statement_stats\" when " - "\"log_parser_stats\", \"log_planner_stats\", " - "or \"log_executor_stats\" is true."); + GUC_check_errdetail("Cannot enable log_statement_stats when " + "log_parser_stats, log_planner_stats, " + "or log_executor_stats is true."); return false; } return true; diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c index fca9a2a..8ef5bf0 100644 --- a/src/backend/utils/adt/datetime.c +++ b/src/backend/utils/adt/datetime.c @@ -4022,7 +4022,7 @@ DateTimeParseError(int dterr, DateTimeErrorExtra *extra, (errcode(ERRCODE_DATETIME_FIELD_OVERFLOW), errmsg("date/time field value out of range: \"%s\"", str), - errhint("Perhaps you need a different \"datestyle\" setting."))); + errhint("Perhaps you need a different DateStyle setting."))); break; case DTERR_INTERVAL_OVERFLOW: errsave(escontext, diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c index d5003da..1dee462 100644 --- a/src/backend/utils/adt/pg_locale.c +++ b/src/backend/utils/adt/pg_locale.c @@ -2875,7 +2875,7 @@ icu_validate_locale(const char *loc_str) ereport(elevel, (errmsg("could not get language from ICU locale \"%s\": %s", loc_str, u_errorName(status)), - errhint("To disable ICU locale validation, set the parameter \"%s\" to \"%s\".", + errhint("To disable ICU locale validation, set the parameter %s to \"%s\".", "icu_validation_level", "disabled"))); return; } @@ -2904,7 +2904,7 @@ icu_validate_locale(const char *loc_str) ereport(elevel, (errmsg("ICU locale \"%s\" has unknown language \"%s\"", loc_str, lang), - errhint("To disable ICU locale validation, set the parameter \"%s\" to \"%s\".", + errhint("To disable ICU locale validation, set the parameter %s to \"%s\".", "icu_validation_level", "disabled"))); /* check that it can be opened */ diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c index b85d52c..56724ff 100644 --- a/src/backend/utils/fmgr/dfmgr.c +++ b/src/backend/utils/fmgr/dfmgr.c @@ -555,7 +555,7 @@ find_in_dynamic_libpath(const char *basename) if (piece == p) ereport(ERROR, (errcode(ERRCODE_INVALID_NAME), - errmsg("zero-length component in parameter \"dynamic_library_path\""))); + errmsg("zero-length component in parameter dynamic_library_path"))); if (piece == NULL) len = strlen(p); @@ -574,7 +574,7 @@ find_in_dynamic_libpath(const char *basename) if (!is_absolute_path(mangled)) ereport(ERROR, (errcode(ERRCODE_INVALID_NAME), - errmsg("component in parameter \"dynamic_library_path\" is not an absolute path"))); + errmsg("component in parameter dynamic_library_path is not an absolute path"))); full = palloc(strlen(mangled) + 1 + baselen + 1); sprintf(full, "%s/%s", mangled, basename); diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 82d8efb..e76c083 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -1873,7 +1873,7 @@ SelectConfigFiles(const char *userDoption, const char *progname) else { write_stderr("%s does not know where to find the database system data.\n" - "This can be specified as \"data_directory\" in \"%s\", " + "This can be specified as data_directory in \"%s\", " "or by the -D invocation option, or by the " "PGDATA environment variable.\n", progname, ConfigFileName); diff --git a/src/backend/utils/misc/guc_tables.c b/src/backend/utils/misc/guc_tables.c index b764ef6..67fedb2 100644 --- a/src/backend/utils/misc/guc_tables.c +++ b/src/backend/utils/misc/guc_tables.c @@ -3811,7 +3811,7 @@ struct config_string ConfigureNamesString[] = { {"archive_command", PGC_SIGHUP, WAL_ARCHIVING, gettext_noop("Sets the shell command that will be called to archive a WAL file."), - gettext_noop("This is used only if \"archive_library\" is not set.") + gettext_noop("This is used only if archive_library is not set.") }, &XLogArchiveCommand, "", @@ -3821,7 +3821,7 @@ struct config_string ConfigureNamesString[] = { {"archive_library", PGC_SIGHUP, WAL_ARCHIVING, gettext_noop("Sets the library that will be called to archive a WAL file."), - gettext_noop("An empty string indicates that \"archive_command\" should be used.") + gettext_noop("An empty string indicates that archive_command should be used.") }, &XLogArchiveLibrary, "", diff --git a/src/test/regress/expected/collate.icu.utf8.out b/src/test/regress/expected/collate.icu.utf8.out index 97bbe53..7a05c75 100644 --- a/src/test/regress/expected/collate.icu.utf8.out +++ b/src/test/regress/expected/collate.icu.utf8.out @@ -1042,7 +1042,7 @@ ERROR: parameter "locale" must be specified SET icu_validation_level = ERROR; CREATE COLLATION testx (provider = icu, locale = 'nonsense-nowhere'); -- fails ERROR: ICU locale "nonsense-nowhere" has unknown language "nonsense" -HINT: To disable ICU locale validation, set the parameter "icu_validation_level" to "disabled". +HINT: To disable ICU locale validation, set the parameter icu_validation_level to "disabled". CREATE COLLATION testx (provider = icu, locale = '@colStrength=primary;nonsense=yes'); -- fails ERROR: could not convert locale name "@colStrength=primary;nonsense=yes" to language tag: U_ILLEGAL_ARGUMENT_ERROR RESET icu_validation_level; @@ -1050,7 +1050,7 @@ CREATE COLLATION testx (provider = icu, locale = '@colStrength=primary;nonsense= WARNING: could not convert locale name "@colStrength=primary;nonsense=yes" to language tag: U_ILLEGAL_ARGUMENT_ERROR CREATE COLLATION testx (provider = icu, locale = 'nonsense-nowhere'); DROP COLLATION testx; WARNING: ICU locale "nonsense-nowhere" has unknown language "nonsense" -HINT: To disable ICU locale validation, set the parameter "icu_validation_level" to "disabled". +HINT: To disable ICU locale validation, set the parameter icu_validation_level to "disabled". CREATE COLLATION test4 FROM nonsense; ERROR: collation "nonsense" for encoding "UTF8" does not exist CREATE COLLATION test5 FROM test0; diff --git a/src/test/regress/expected/date.out b/src/test/regress/expected/date.out index f5949f3..99650bf 100644 --- a/src/test/regress/expected/date.out +++ b/src/test/regress/expected/date.out @@ -94,17 +94,17 @@ SELECT date '1/8/1999'; ERROR: date/time field value out of range: "1/8/1999" LINE 1: SELECT date '1/8/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1/18/1999'; ERROR: date/time field value out of range: "1/18/1999" LINE 1: SELECT date '1/18/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '18/1/1999'; ERROR: date/time field value out of range: "18/1/1999" LINE 1: SELECT date '18/1/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01/02/03'; date ------------ @@ -139,7 +139,7 @@ SELECT date 'January 8, 99 BC'; ERROR: date/time field value out of range: "January 8, 99 BC" LINE 1: SELECT date 'January 8, 99 BC'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '99-Jan-08'; date ------------ @@ -156,7 +156,7 @@ SELECT date '08-Jan-99'; ERROR: date/time field value out of range: "08-Jan-99" LINE 1: SELECT date '08-Jan-99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '08-Jan-1999'; date ------------ @@ -167,7 +167,7 @@ SELECT date 'Jan-08-99'; ERROR: date/time field value out of range: "Jan-08-99" LINE 1: SELECT date 'Jan-08-99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date 'Jan-08-1999'; date ------------ @@ -198,7 +198,7 @@ SELECT date '08 Jan 99'; ERROR: date/time field value out of range: "08 Jan 99" LINE 1: SELECT date '08 Jan 99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '08 Jan 1999'; date ------------ @@ -209,7 +209,7 @@ SELECT date 'Jan 08 99'; ERROR: date/time field value out of range: "Jan 08 99" LINE 1: SELECT date 'Jan 08 99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date 'Jan 08 1999'; date ------------ @@ -244,22 +244,22 @@ SELECT date '08-01-99'; ERROR: date/time field value out of range: "08-01-99" LINE 1: SELECT date '08-01-99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '08-01-1999'; ERROR: date/time field value out of range: "08-01-1999" LINE 1: SELECT date '08-01-1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01-08-99'; ERROR: date/time field value out of range: "01-08-99" LINE 1: SELECT date '01-08-99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01-08-1999'; ERROR: date/time field value out of range: "01-08-1999" LINE 1: SELECT date '01-08-1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '99-08-01'; date ------------ @@ -288,22 +288,22 @@ SELECT date '08 01 99'; ERROR: date/time field value out of range: "08 01 99" LINE 1: SELECT date '08 01 99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '08 01 1999'; ERROR: date/time field value out of range: "08 01 1999" LINE 1: SELECT date '08 01 1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01 08 99'; ERROR: date/time field value out of range: "01 08 99" LINE 1: SELECT date '01 08 99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01 08 1999'; ERROR: date/time field value out of range: "01 08 1999" LINE 1: SELECT date '01 08 1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '99 08 01'; date ------------ @@ -345,7 +345,7 @@ SELECT date '1/18/1999'; ERROR: date/time field value out of range: "1/18/1999" LINE 1: SELECT date '1/18/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '18/1/1999'; date ------------ @@ -392,7 +392,7 @@ SELECT date '99-Jan-08'; ERROR: date/time field value out of range: "99-Jan-08" LINE 1: SELECT date '99-Jan-08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-Jan-08'; date ------------ @@ -435,7 +435,7 @@ SELECT date '99 Jan 08'; ERROR: date/time field value out of range: "99 Jan 08" LINE 1: SELECT date '99 Jan 08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 Jan 08'; date ------------ @@ -480,7 +480,7 @@ SELECT date '99-01-08'; ERROR: date/time field value out of range: "99-01-08" LINE 1: SELECT date '99-01-08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-01-08'; date ------------ @@ -515,7 +515,7 @@ SELECT date '99-08-01'; ERROR: date/time field value out of range: "99-08-01" LINE 1: SELECT date '99-08-01'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-08-01'; date ------------ @@ -526,7 +526,7 @@ SELECT date '99 01 08'; ERROR: date/time field value out of range: "99 01 08" LINE 1: SELECT date '99 01 08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 01 08'; date ------------ @@ -561,7 +561,7 @@ SELECT date '99 08 01'; ERROR: date/time field value out of range: "99 08 01" LINE 1: SELECT date '99 08 01'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 08 01'; date ------------ @@ -603,7 +603,7 @@ SELECT date '18/1/1999'; ERROR: date/time field value out of range: "18/1/1999" LINE 1: SELECT date '18/1/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01/02/03'; date ------------ @@ -644,7 +644,7 @@ SELECT date '99-Jan-08'; ERROR: date/time field value out of range: "99-Jan-08" LINE 1: SELECT date '99-Jan-08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-Jan-08'; date ------------ @@ -731,7 +731,7 @@ SELECT date '99-01-08'; ERROR: date/time field value out of range: "99-01-08" LINE 1: SELECT date '99-01-08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-01-08'; date ------------ @@ -766,7 +766,7 @@ SELECT date '99-08-01'; ERROR: date/time field value out of range: "99-08-01" LINE 1: SELECT date '99-08-01'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-08-01'; date ------------ @@ -777,7 +777,7 @@ SELECT date '99 01 08'; ERROR: date/time field value out of range: "99 01 08" LINE 1: SELECT date '99 01 08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 01 08'; date ------------ @@ -812,7 +812,7 @@ SELECT date '99 08 01'; ERROR: date/time field value out of range: "99 08 01" LINE 1: SELECT date '99 08 01'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 08 01'; date ------------ diff --git a/src/test/regress/expected/horology.out b/src/test/regress/expected/horology.out index cfb4b20..4aeefd5 100644 --- a/src/test/regress/expected/horology.out +++ b/src/test/regress/expected/horology.out @@ -100,7 +100,7 @@ SELECT timestamp with time zone '27/12/2001 04:05:06.789-08'; ERROR: date/time field value out of range: "27/12/2001 04:05:06.789-08" LINE 1: SELECT timestamp with time zone '27/12/2001 04:05:06.789-08'... ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. set datestyle to dmy; SELECT timestamp with time zone '27/12/2001 04:05:06.789-08'; timestamptz diff --git a/src/test/regress/expected/json.out b/src/test/regress/expected/json.out index aa29bc5..7cb28f1 100644 --- a/src/test/regress/expected/json.out +++ b/src/test/regress/expected/json.out @@ -219,10 +219,10 @@ CONTEXT: JSON data, line 1: {"abc":1,3... SET max_stack_depth = '100kB'; SELECT repeat('[', 10000)::json; ERROR: stack depth limit exceeded -HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate. +HINT: Increase the configuration parameter max_stack_depth (currently 100kB), after ensuring the platform's stack depth limit is adequate. SELECT repeat('{"a":', 10000)::json; ERROR: stack depth limit exceeded -HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate. +HINT: Increase the configuration parameter max_stack_depth (currently 100kB), after ensuring the platform's stack depth limit is adequate. RESET max_stack_depth; -- Miscellaneous stuff. SELECT 'true'::json; -- OK diff --git a/src/test/regress/expected/jsonb.out b/src/test/regress/expected/jsonb.out index f8a7dac..b597d01 100644 --- a/src/test/regress/expected/jsonb.out +++ b/src/test/regress/expected/jsonb.out @@ -213,10 +213,10 @@ CONTEXT: JSON data, line 1: {"abc":1,3... SET max_stack_depth = '100kB'; SELECT repeat('[', 10000)::jsonb; ERROR: stack depth limit exceeded -HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate. +HINT: Increase the configuration parameter max_stack_depth (currently 100kB), after ensuring the platform's stack depth limit is adequate. SELECT repeat('{"a":', 10000)::jsonb; ERROR: stack depth limit exceeded -HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate. +HINT: Increase the configuration parameter max_stack_depth (currently 100kB), after ensuring the platform's stack depth limit is adequate. RESET max_stack_depth; -- Miscellaneous stuff. SELECT 'true'::jsonb; -- OK -- 1.8.3.1 [application/octet-stream] v2-0003-GUC-names-maybe-add-quotes.patch (41.4K, ../../CAHut+PtOqRPyVuX=xL=EhDAEWkpBh2MgeSW1KoyMjru-tEWO9w@mail.gmail.com/4-v2-0003-GUC-names-maybe-add-quotes.patch) download | inline diff: From 7f0c7522731c5ce134311a522be17a9991fd6135 Mon Sep 17 00:00:00 2001 From: Peter Smith <[email protected]> Date: Mon, 27 Nov 2023 09:35:11 +1100 Subject: [PATCH v2] GUC names - maybe add quotes --- src/backend/utils/misc/guc.c | 233 +++++++++++++-------- .../test_oat_hooks/expected/test_oat_hooks.out | 4 +- .../modules/unsafe_tests/expected/guc_privs.out | 54 ++--- .../modules/unsafe_tests/expected/rolenames.out | 2 +- src/test/regress/expected/compression.out | 4 +- src/test/regress/expected/compression_1.out | 6 +- src/test/regress/expected/create_am.out | 4 +- src/test/regress/expected/guc.out | 10 +- src/test/regress/expected/password.out | 4 +- src/test/regress/expected/subscription.out | 2 +- src/test/regress/expected/transactions.out | 8 +- 11 files changed, 193 insertions(+), 138 deletions(-) diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index e76c083..e91aa2d 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -267,6 +267,52 @@ static bool call_enum_check_hook(struct config_enum *conf, int *newval, /* + * Return the GUC name, maybe enclosed in double-quotes. + * + * The purpose is to only quote names which potential could be mistaken for + * normal English words. + * + * - Lowercase alpha needs quotes unless there are underscores. + * - Upper/mixed case alpha does not need quotes. + * - Anything else needs quotes + * + * TAKE CARE: The function returns a reference to a static buffer. It is fine + * for the intended purpose of single GUC substitions into log messages, but + * it might not be suitable for other use cases. + */ +static +char * +maybe_quote_GUC_name(const char *name) +{ + static char buf[64]; + + bool need_quotes; + + bool underscore = false; + bool lowercase = false; + bool uppercase = false; + bool special = false; + + for (const char *p = name; *p; p++) + { + if (*p == '_') + underscore = true; + else if ('a' <= *p && *p <= 'z') + lowercase = true; + else if ('A' <= *p && *p <= 'Z') + uppercase = true; + else + special = true; + } + + need_quotes = special || (lowercase && !underscore && !uppercase); + + sprintf(buf, need_quotes ? "\"%s\"" : "%s", name); + return buf; +} + + +/* * This function handles both actual config file (re)loads and execution of * show_all_file_settings() (i.e., the pg_file_settings view). In the latter * case we don't apply any of the settings, but we make all the usual validity @@ -420,8 +466,8 @@ ProcessConfigFileInternal(GucContext context, bool applySettings, int elevel) /* Invalid non-custom variable, so complain */ ereport(elevel, (errcode(ERRCODE_UNDEFINED_OBJECT), - errmsg("unrecognized configuration parameter \"%s\" in file \"%s\" line %d", - item->name, + errmsg("unrecognized configuration parameter %s in file \"%s\" line %d", + maybe_quote_GUC_name(item->name), item->filename, item->sourceline))); item->errmsg = pstrdup("unrecognized configuration parameter"); error = true; @@ -460,10 +506,10 @@ ProcessConfigFileInternal(GucContext context, bool applySettings, int elevel) gconf->status |= GUC_PENDING_RESTART; ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed without restarting the server", - gconf->name))); - record_config_file_error(psprintf("parameter \"%s\" cannot be changed without restarting the server", - gconf->name), + errmsg("parameter %s cannot be changed without restarting the server", + maybe_quote_GUC_name(gconf->name)))); + record_config_file_error(psprintf("parameter %s cannot be changed without restarting the server", + maybe_quote_GUC_name(gconf->name)), NULL, 0, &head, &tail); error = true; @@ -496,8 +542,8 @@ ProcessConfigFileInternal(GucContext context, bool applySettings, int elevel) /* Log the change if appropriate */ if (context == PGC_SIGHUP) ereport(elevel, - (errmsg("parameter \"%s\" removed from configuration file, reset to default", - gconf->name))); + (errmsg("parameter %s removed from configuration file, reset to default", + maybe_quote_GUC_name(gconf->name)))); } } @@ -561,8 +607,9 @@ ProcessConfigFileInternal(GucContext context, bool applySettings, int elevel) post_value = ""; if (strcmp(pre_value, post_value) != 0) ereport(elevel, - (errmsg("parameter \"%s\" changed to \"%s\"", - item->name, item->value))); + (errmsg("parameter %s changed to \"%s\"", + maybe_quote_GUC_name(item->name), + item->value))); } item->applied = true; } @@ -1129,8 +1176,8 @@ assignable_custom_variable_name(const char *name, bool skip_errors, int elevel) if (!skip_errors) ereport(elevel, (errcode(ERRCODE_INVALID_NAME), - errmsg("invalid configuration parameter name \"%s\"", - name), + errmsg("invalid configuration parameter name %s", + maybe_quote_GUC_name(name)), errdetail("Custom parameter names must be two or more simple identifiers separated by dots."))); return false; } @@ -1145,8 +1192,8 @@ assignable_custom_variable_name(const char *name, bool skip_errors, int elevel) if (!skip_errors) ereport(elevel, (errcode(ERRCODE_INVALID_NAME), - errmsg("invalid configuration parameter name \"%s\"", - name), + errmsg("invalid configuration parameter name %s", + maybe_quote_GUC_name(name)), errdetail("\"%s\" is a reserved prefix.", rcprefix))); return false; @@ -1160,8 +1207,8 @@ assignable_custom_variable_name(const char *name, bool skip_errors, int elevel) if (!skip_errors) ereport(elevel, (errcode(ERRCODE_UNDEFINED_OBJECT), - errmsg("unrecognized configuration parameter \"%s\"", - name))); + errmsg("unrecognized configuration parameter %s", + maybe_quote_GUC_name(name)))); return false; } @@ -1270,8 +1317,8 @@ find_option(const char *name, bool create_placeholders, bool skip_errors, if (!skip_errors) ereport(elevel, (errcode(ERRCODE_UNDEFINED_OBJECT), - errmsg("unrecognized configuration parameter \"%s\"", - name))); + errmsg("unrecognized configuration parameter %s", + maybe_quote_GUC_name(name)))); return NULL; } @@ -3125,8 +3172,8 @@ parse_and_validate_value(struct config_generic *record, { ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("parameter \"%s\" requires a Boolean value", - name))); + errmsg("parameter %s requires a Boolean value", + maybe_quote_GUC_name(name)))); return false; } @@ -3145,8 +3192,8 @@ parse_and_validate_value(struct config_generic *record, { ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("invalid value for parameter \"%s\": \"%s\"", - name, value), + errmsg("invalid value for parameter %s: \"%s\"", + maybe_quote_GUC_name(name), value), hintmsg ? errhint("%s", _(hintmsg)) : 0)); return false; } @@ -3157,11 +3204,11 @@ parse_and_validate_value(struct config_generic *record, ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("%d%s%s is outside the valid range for parameter \"%s\" (%d .. %d)", + errmsg("%d%s%s is outside the valid range for parameter %s (%d .. %d)", newval->intval, unit ? " " : "", unit ? unit : "", - name, + maybe_quote_GUC_name(name), conf->min, conf->max))); return false; } @@ -3181,8 +3228,8 @@ parse_and_validate_value(struct config_generic *record, { ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("invalid value for parameter \"%s\": \"%s\"", - name, value), + errmsg("invalid value for parameter %s: \"%s\"", + maybe_quote_GUC_name(name), value), hintmsg ? errhint("%s", _(hintmsg)) : 0)); return false; } @@ -3193,11 +3240,11 @@ parse_and_validate_value(struct config_generic *record, ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("%g%s%s is outside the valid range for parameter \"%s\" (%g .. %g)", + errmsg("%g%s%s is outside the valid range for parameter %s (%g .. %g)", newval->realval, unit ? " " : "", unit ? unit : "", - name, + maybe_quote_GUC_name(name), conf->min, conf->max))); return false; } @@ -3251,8 +3298,8 @@ parse_and_validate_value(struct config_generic *record, ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("invalid value for parameter \"%s\": \"%s\"", - name, value), + errmsg("invalid value for parameter %s: \"%s\"", + maybe_quote_GUC_name(name), value), hintmsg ? errhint("%s", _(hintmsg)) : 0)); if (hintmsg) @@ -3410,8 +3457,8 @@ set_config_option_ext(const char *name, const char *value, { ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed", - name))); + errmsg("parameter %s cannot be changed", + maybe_quote_GUC_name(name)))); return 0; } break; @@ -3433,8 +3480,8 @@ set_config_option_ext(const char *name, const char *value, { ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed without restarting the server", - name))); + errmsg("parameter %s cannot be changed without restarting the server", + maybe_quote_GUC_name(name)))); return 0; } break; @@ -3443,8 +3490,8 @@ set_config_option_ext(const char *name, const char *value, { ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed now", - name))); + errmsg("parameter %s cannot be changed now", + maybe_quote_GUC_name(name)))); return 0; } @@ -3470,8 +3517,8 @@ set_config_option_ext(const char *name, const char *value, /* No granted privilege */ ereport(elevel, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("permission denied to set parameter \"%s\"", - name))); + errmsg("permission denied to set parameter %s", + maybe_quote_GUC_name(name)))); return 0; } } @@ -3508,8 +3555,8 @@ set_config_option_ext(const char *name, const char *value, { ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be set after connection start", - name))); + errmsg("parameter %s cannot be set after connection start", + maybe_quote_GUC_name(name)))); return 0; } break; @@ -3528,8 +3575,8 @@ set_config_option_ext(const char *name, const char *value, /* No granted privilege */ ereport(elevel, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("permission denied to set parameter \"%s\"", - name))); + errmsg("permission denied to set parameter %s", + maybe_quote_GUC_name(name)))); return 0; } } @@ -3567,16 +3614,16 @@ set_config_option_ext(const char *name, const char *value, */ ereport(elevel, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("cannot set parameter \"%s\" within security-definer function", - name))); + errmsg("cannot set parameter %s within security-definer function", + maybe_quote_GUC_name(name)))); return 0; } if (InSecurityRestrictedOperation()) { ereport(elevel, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("cannot set parameter \"%s\" within security-restricted operation", - name))); + errmsg("cannot set parameter %s within security-restricted operation", + maybe_quote_GUC_name(name)))); return 0; } } @@ -3588,15 +3635,16 @@ set_config_option_ext(const char *name, const char *value, { ereport(elevel, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("parameter \"%s\" cannot be reset", name))); + errmsg("parameter %s cannot be reset", + maybe_quote_GUC_name(name)))); return 0; } if (action == GUC_ACTION_SAVE) { ereport(elevel, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("parameter \"%s\" cannot be set locally in functions", - name))); + errmsg("parameter %s cannot be set locally in functions", + maybe_quote_GUC_name(name)))); return 0; } } @@ -3621,8 +3669,8 @@ set_config_option_ext(const char *name, const char *value, { if (changeVal && !makeDefault) { - elog(DEBUG3, "\"%s\": setting ignored because previous source is higher priority", - name); + elog(DEBUG3, "%s: setting ignored because previous source is higher priority", + maybe_quote_GUC_name(name)); return -1; } changeVal = false; @@ -3673,8 +3721,8 @@ set_config_option_ext(const char *name, const char *value, record->status |= GUC_PENDING_RESTART; ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed without restarting the server", - name))); + errmsg("parameter %s cannot be changed without restarting the server", + maybe_quote_GUC_name(name)))); return 0; } record->status &= ~GUC_PENDING_RESTART; @@ -3771,8 +3819,8 @@ set_config_option_ext(const char *name, const char *value, record->status |= GUC_PENDING_RESTART; ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed without restarting the server", - name))); + errmsg("parameter %s cannot be changed without restarting the server", + maybe_quote_GUC_name(name)))); return 0; } record->status &= ~GUC_PENDING_RESTART; @@ -3869,8 +3917,8 @@ set_config_option_ext(const char *name, const char *value, record->status |= GUC_PENDING_RESTART; ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed without restarting the server", - name))); + errmsg("parameter %s cannot be changed without restarting the server", + maybe_quote_GUC_name(name)))); return 0; } record->status &= ~GUC_PENDING_RESTART; @@ -3993,8 +4041,8 @@ set_config_option_ext(const char *name, const char *value, record->status |= GUC_PENDING_RESTART; ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed without restarting the server", - name))); + errmsg("parameter %s cannot be changed without restarting the server", + maybe_quote_GUC_name(name)))); return 0; } record->status &= ~GUC_PENDING_RESTART; @@ -4096,8 +4144,8 @@ set_config_option_ext(const char *name, const char *value, record->status |= GUC_PENDING_RESTART; ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed without restarting the server", - name))); + errmsg("parameter %s cannot be changed without restarting the server", + maybe_quote_GUC_name(name)))); return 0; } record->status &= ~GUC_PENDING_RESTART; @@ -4238,7 +4286,8 @@ GetConfigOption(const char *name, bool missing_ok, bool restrict_privileged) !ConfigOptionIsVisible(record)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("permission denied to examine \"%s\"", name), + errmsg("permission denied to examine %s", + maybe_quote_GUC_name(name)), errdetail("Only roles with privileges of the \"%s\" role may examine this parameter.", "pg_read_all_settings"))); @@ -4534,8 +4583,8 @@ AlterSystemSetConfigFile(AlterSystemStmt *altersysstmt) if (aclresult != ACLCHECK_OK) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("permission denied to set parameter \"%s\"", - name))); + errmsg("permission denied to set parameter %s", + maybe_quote_GUC_name(name)))); } } @@ -4559,8 +4608,8 @@ AlterSystemSetConfigFile(AlterSystemStmt *altersysstmt) (record->flags & GUC_DISALLOW_IN_AUTO_FILE)) ereport(ERROR, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed", - name))); + errmsg("parameter %s cannot be changed", + maybe_quote_GUC_name(name)))); /* * If a value is specified, verify that it's sane. @@ -4575,8 +4624,8 @@ AlterSystemSetConfigFile(AlterSystemStmt *altersysstmt) &newval, &newextra)) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("invalid value for parameter \"%s\": \"%s\"", - name, value))); + errmsg("invalid value for parameter %s: \"%s\"", + maybe_quote_GUC_name(name), value))); if (record->vartype == PGC_STRING && newval.stringval != NULL) guc_free(newval.stringval); @@ -4830,7 +4879,8 @@ define_custom_variable(struct config_generic *variable) if ((hentry->gucvar->flags & GUC_CUSTOM_PLACEHOLDER) == 0) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), - errmsg("attempt to redefine parameter \"%s\"", name))); + errmsg("attempt to redefine parameter %s", + maybe_quote_GUC_name(name)))); Assert(hentry->gucvar->vartype == PGC_STRING); pHolder = (struct config_string *) hentry->gucvar; @@ -5169,8 +5219,8 @@ MarkGUCPrefixReserved(const char *className) { ereport(WARNING, (errcode(ERRCODE_INVALID_NAME), - errmsg("invalid configuration parameter name \"%s\", removing it", - var->name), + errmsg("invalid configuration parameter name %s, removing it", + maybe_quote_GUC_name(var->name)), errdetail("\"%s\" is now a reserved prefix.", className))); /* Remove it from the hash table */ @@ -5313,7 +5363,8 @@ GetConfigOptionByName(const char *name, const char **varname, bool missing_ok) if (!ConfigOptionIsVisible(record)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("permission denied to examine \"%s\"", name), + errmsg("permission denied to examine %s", + maybe_quote_GUC_name(name)), errdetail("Only roles with privileges of the \"%s\" role may examine this parameter.", "pg_read_all_settings"))); @@ -5639,7 +5690,8 @@ read_nondefault_variables(void) break; if (find_option(varname, true, false, FATAL) == NULL) - elog(FATAL, "failed to locate variable \"%s\" in exec config params file", varname); + elog(FATAL, "failed to locate variable %s in exec config params file", + maybe_quote_GUC_name(varname)); if ((varvalue = read_string_with_null(fp)) == NULL) elog(FATAL, "invalid format of exec config params file"); @@ -6048,8 +6100,8 @@ guc_restore_error_context_callback(void *arg) char **error_context_name_and_value = (char **) arg; if (error_context_name_and_value) - errcontext("while setting parameter \"%s\" to \"%s\"", - error_context_name_and_value[0], + errcontext("while setting parameter %s to \"%s\"", + maybe_quote_GUC_name(error_context_name_and_value[0]), error_context_name_and_value[1]); } @@ -6217,7 +6269,8 @@ RestoreGUCState(void *gucstate) if (result <= 0) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), - errmsg("parameter \"%s\" could not be set", varname))); + errmsg("parameter %s could not be set", + maybe_quote_GUC_name(varname)))); if (varsourcefile[0]) set_config_sourcefile(varname, varsourcefile, varsourceline); error_context_callback.arg = NULL; @@ -6307,8 +6360,8 @@ TransformGUCArray(ArrayType *array, List **names, List **values) { ereport(WARNING, (errcode(ERRCODE_SYNTAX_ERROR), - errmsg("could not parse setting for parameter \"%s\"", - name))); + errmsg("could not parse setting for parameter %s", + maybe_quote_GUC_name(name)))); pfree(name); continue; } @@ -6625,7 +6678,8 @@ validate_option_array_item(const char *name, const char *value, return false; ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("permission denied to set parameter \"%s\"", name))); + errmsg("permission denied to set parameter %s", + maybe_quote_GUC_name(name)))); } /* manual permissions check so we can avoid an error being thrown */ @@ -6689,8 +6743,8 @@ call_bool_check_hook(struct config_bool *conf, bool *newval, void **extra, (errcode(GUC_check_errcode_value), GUC_check_errmsg_string ? errmsg_internal("%s", GUC_check_errmsg_string) : - errmsg("invalid value for parameter \"%s\": %d", - conf->gen.name, (int) *newval), + errmsg("invalid value for parameter %s: %d", + maybe_quote_GUC_name(conf->gen.name), (int) *newval), GUC_check_errdetail_string ? errdetail_internal("%s", GUC_check_errdetail_string) : 0, GUC_check_errhint_string ? @@ -6723,8 +6777,8 @@ call_int_check_hook(struct config_int *conf, int *newval, void **extra, (errcode(GUC_check_errcode_value), GUC_check_errmsg_string ? errmsg_internal("%s", GUC_check_errmsg_string) : - errmsg("invalid value for parameter \"%s\": %d", - conf->gen.name, *newval), + errmsg("invalid value for parameter %s: %d", + maybe_quote_GUC_name(conf->gen.name), *newval), GUC_check_errdetail_string ? errdetail_internal("%s", GUC_check_errdetail_string) : 0, GUC_check_errhint_string ? @@ -6757,8 +6811,8 @@ call_real_check_hook(struct config_real *conf, double *newval, void **extra, (errcode(GUC_check_errcode_value), GUC_check_errmsg_string ? errmsg_internal("%s", GUC_check_errmsg_string) : - errmsg("invalid value for parameter \"%s\": %g", - conf->gen.name, *newval), + errmsg("invalid value for parameter %s: %g", + maybe_quote_GUC_name(conf->gen.name), *newval), GUC_check_errdetail_string ? errdetail_internal("%s", GUC_check_errdetail_string) : 0, GUC_check_errhint_string ? @@ -6800,8 +6854,9 @@ call_string_check_hook(struct config_string *conf, char **newval, void **extra, (errcode(GUC_check_errcode_value), GUC_check_errmsg_string ? errmsg_internal("%s", GUC_check_errmsg_string) : - errmsg("invalid value for parameter \"%s\": \"%s\"", - conf->gen.name, *newval ? *newval : ""), + errmsg("invalid value for parameter %s: \"%s\"", + maybe_quote_GUC_name(conf->gen.name), + *newval ? *newval : ""), GUC_check_errdetail_string ? errdetail_internal("%s", GUC_check_errdetail_string) : 0, GUC_check_errhint_string ? @@ -6841,8 +6896,8 @@ call_enum_check_hook(struct config_enum *conf, int *newval, void **extra, (errcode(GUC_check_errcode_value), GUC_check_errmsg_string ? errmsg_internal("%s", GUC_check_errmsg_string) : - errmsg("invalid value for parameter \"%s\": \"%s\"", - conf->gen.name, + errmsg("invalid value for parameter %s: \"%s\"", + maybe_quote_GUC_name(conf->gen.name), config_enum_lookup_by_value(conf, *newval)), GUC_check_errdetail_string ? errdetail_internal("%s", GUC_check_errdetail_string) : 0, diff --git a/src/test/modules/test_oat_hooks/expected/test_oat_hooks.out b/src/test/modules/test_oat_hooks/expected/test_oat_hooks.out index f80373a..ccaa65e 100644 --- a/src/test/modules/test_oat_hooks/expected/test_oat_hooks.out +++ b/src/test/modules/test_oat_hooks/expected/test_oat_hooks.out @@ -180,10 +180,10 @@ NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, NOTICE: in process utility: non-superuser finished RESET ALTER SYSTEM SET work_mem = 8192; NOTICE: in process utility: non-superuser attempting ALTER SYSTEM -ERROR: permission denied to set parameter "work_mem" +ERROR: permission denied to set parameter work_mem ALTER SYSTEM RESET work_mem; NOTICE: in process utility: non-superuser attempting ALTER SYSTEM -ERROR: permission denied to set parameter "work_mem" +ERROR: permission denied to set parameter work_mem SET test_oat_hooks.user_var1 = true; NOTICE: in process utility: non-superuser attempting SET NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [test_oat_hooks.user_var1] diff --git a/src/test/modules/unsafe_tests/expected/guc_privs.out b/src/test/modules/unsafe_tests/expected/guc_privs.out index 6c0ad89..5ed2113 100644 --- a/src/test/modules/unsafe_tests/expected/guc_privs.out +++ b/src/test/modules/unsafe_tests/expected/guc_privs.out @@ -8,31 +8,31 @@ CREATE ROLE regress_admin SUPERUSER; SET SESSION AUTHORIZATION regress_admin; -- PGC_BACKEND SET ignore_system_indexes = OFF; -- fail, cannot be set after connection start -ERROR: parameter "ignore_system_indexes" cannot be set after connection start +ERROR: parameter ignore_system_indexes cannot be set after connection start RESET ignore_system_indexes; -- fail, cannot be set after connection start -ERROR: parameter "ignore_system_indexes" cannot be set after connection start +ERROR: parameter ignore_system_indexes cannot be set after connection start ALTER SYSTEM SET ignore_system_indexes = OFF; -- ok ALTER SYSTEM RESET ignore_system_indexes; -- ok -- PGC_INTERNAL SET block_size = 50; -- fail, cannot be changed -ERROR: parameter "block_size" cannot be changed +ERROR: parameter block_size cannot be changed RESET block_size; -- fail, cannot be changed -ERROR: parameter "block_size" cannot be changed +ERROR: parameter block_size cannot be changed ALTER SYSTEM SET block_size = 50; -- fail, cannot be changed -ERROR: parameter "block_size" cannot be changed +ERROR: parameter block_size cannot be changed ALTER SYSTEM RESET block_size; -- fail, cannot be changed -ERROR: parameter "block_size" cannot be changed +ERROR: parameter block_size cannot be changed -- PGC_POSTMASTER SET autovacuum_freeze_max_age = 1000050000; -- fail, requires restart -ERROR: parameter "autovacuum_freeze_max_age" cannot be changed without restarting the server +ERROR: parameter autovacuum_freeze_max_age cannot be changed without restarting the server RESET autovacuum_freeze_max_age; -- fail, requires restart -ERROR: parameter "autovacuum_freeze_max_age" cannot be changed without restarting the server +ERROR: parameter autovacuum_freeze_max_age cannot be changed without restarting the server ALTER SYSTEM SET autovacuum_freeze_max_age = 1000050000; -- ok ALTER SYSTEM RESET autovacuum_freeze_max_age; -- ok ALTER SYSTEM SET config_file = '/usr/local/data/postgresql.conf'; -- fail, cannot be changed -ERROR: parameter "config_file" cannot be changed +ERROR: parameter config_file cannot be changed ALTER SYSTEM RESET config_file; -- fail, cannot be changed -ERROR: parameter "config_file" cannot be changed +ERROR: parameter config_file cannot be changed -- PGC_SIGHUP SET autovacuum = OFF; -- fail, requires reload ERROR: parameter "autovacuum" cannot be changed now @@ -47,9 +47,9 @@ ALTER SYSTEM SET lc_messages = 'C'; -- ok ALTER SYSTEM RESET lc_messages; -- ok -- PGC_SU_BACKEND SET jit_debugging_support = OFF; -- fail, cannot be set after connection start -ERROR: parameter "jit_debugging_support" cannot be set after connection start +ERROR: parameter jit_debugging_support cannot be set after connection start RESET jit_debugging_support; -- fail, cannot be set after connection start -ERROR: parameter "jit_debugging_support" cannot be set after connection start +ERROR: parameter jit_debugging_support cannot be set after connection start ALTER SYSTEM SET jit_debugging_support = OFF; -- ok ALTER SYSTEM RESET jit_debugging_support; -- ok -- PGC_USERSET @@ -58,9 +58,9 @@ RESET DateStyle; -- ok ALTER SYSTEM SET DateStyle = 'ISO, MDY'; -- ok ALTER SYSTEM RESET DateStyle; -- ok ALTER SYSTEM SET ssl_renegotiation_limit = 0; -- fail, cannot be changed -ERROR: parameter "ssl_renegotiation_limit" cannot be changed +ERROR: parameter ssl_renegotiation_limit cannot be changed ALTER SYSTEM RESET ssl_renegotiation_limit; -- fail, cannot be changed -ERROR: parameter "ssl_renegotiation_limit" cannot be changed +ERROR: parameter ssl_renegotiation_limit cannot be changed -- Finished testing superuser -- Create non-superuser with privileges to configure host resource usage CREATE ROLE regress_host_resource_admin NOSUPERUSER; @@ -244,7 +244,7 @@ SHOW none.such; -- Can't grant on a non-existent core GUC. GRANT ALL ON PARAMETER no_such_guc TO regress_host_resource_admin; -- fail -ERROR: unrecognized configuration parameter "no_such_guc" +ERROR: unrecognized configuration parameter no_such_guc -- Initially there are no privileges and no catalog entry for this GUC. SELECT has_parameter_privilege('regress_host_resource_admin', 'enable_material', 'SET'); has_parameter_privilege @@ -446,17 +446,17 @@ ALTER ROLE regress_host_resource_admin SET lc_messages = 'C'; SET SESSION AUTHORIZATION regress_host_resource_admin; ALTER SYSTEM SET autovacuum_work_mem = 32; -- ok, privileges have been granted ALTER SYSTEM SET ignore_system_indexes = OFF; -- fail, insufficient privileges -ERROR: permission denied to set parameter "ignore_system_indexes" +ERROR: permission denied to set parameter ignore_system_indexes ALTER SYSTEM RESET autovacuum_multixact_freeze_max_age; -- fail, insufficient privileges -ERROR: permission denied to set parameter "autovacuum_multixact_freeze_max_age" +ERROR: permission denied to set parameter autovacuum_multixact_freeze_max_age SET jit_provider = 'llvmjit'; -- fail, insufficient privileges -ERROR: parameter "jit_provider" cannot be changed without restarting the server +ERROR: parameter jit_provider cannot be changed without restarting the server SELECT set_config ('jit_provider', 'llvmjit', true); -- fail, insufficient privileges -ERROR: parameter "jit_provider" cannot be changed without restarting the server +ERROR: parameter jit_provider cannot be changed without restarting the server ALTER SYSTEM SET shared_buffers = 50; -- ok ALTER SYSTEM RESET shared_buffers; -- ok SET autovacuum_work_mem = 50; -- cannot be changed now -ERROR: parameter "autovacuum_work_mem" cannot be changed now +ERROR: parameter autovacuum_work_mem cannot be changed now ALTER SYSTEM RESET temp_file_limit; -- ok SET TimeZone = 'Europe/Helsinki'; -- ok RESET TimeZone; -- ok @@ -465,13 +465,13 @@ RESET max_stack_depth; -- ok, privileges have been granted ALTER SYSTEM SET max_stack_depth = '100kB'; -- ok, privileges have been granted ALTER SYSTEM RESET max_stack_depth; -- ok, privileges have been granted SET lc_messages = 'C'; -- fail, insufficient privileges -ERROR: permission denied to set parameter "lc_messages" +ERROR: permission denied to set parameter lc_messages RESET lc_messages; -- fail, insufficient privileges -ERROR: permission denied to set parameter "lc_messages" +ERROR: permission denied to set parameter lc_messages ALTER SYSTEM SET lc_messages = 'C'; -- fail, insufficient privileges -ERROR: permission denied to set parameter "lc_messages" +ERROR: permission denied to set parameter lc_messages ALTER SYSTEM RESET lc_messages; -- fail, insufficient privileges -ERROR: permission denied to set parameter "lc_messages" +ERROR: permission denied to set parameter lc_messages SELECT set_config ('temp_buffers', '8192', false); -- ok set_config ------------ @@ -484,7 +484,7 @@ ERROR: permission denied to perform ALTER SYSTEM RESET ALL ALTER SYSTEM SET none.such2 = 'whiz bang'; -- fail, not superuser ERROR: permission denied to set parameter "none.such2" ALTER ROLE regress_host_resource_admin SET lc_messages = 'POSIX'; -- fail -ERROR: permission denied to set parameter "lc_messages" +ERROR: permission denied to set parameter lc_messages ALTER ROLE regress_host_resource_admin SET max_stack_depth = '1MB'; -- ok SELECT setconfig FROM pg_db_role_setting WHERE setrole = 'regress_host_resource_admin'::regrole; @@ -537,7 +537,7 @@ DROP ROLE regress_host_resource_admin; -- ok CREATE ROLE regress_host_resource_admin NOSUPERUSER; SET SESSION AUTHORIZATION regress_host_resource_admin; ALTER SYSTEM SET autovacuum_work_mem = 32; -- fail, privileges not yet granted -ERROR: permission denied to set parameter "autovacuum_work_mem" +ERROR: permission denied to set parameter autovacuum_work_mem SET SESSION AUTHORIZATION regress_admin; GRANT SET, ALTER SYSTEM ON PARAMETER autovacuum_work_mem, hash_mem_multiplier, max_stack_depth, @@ -554,7 +554,7 @@ privileges for parameter work_mem DROP OWNED BY regress_host_resource_admin RESTRICT; -- cascade should not be needed SET SESSION AUTHORIZATION regress_host_resource_admin; ALTER SYSTEM SET autovacuum_work_mem = 32; -- fail, "drop owned" has dropped privileges -ERROR: permission denied to set parameter "autovacuum_work_mem" +ERROR: permission denied to set parameter autovacuum_work_mem SET SESSION AUTHORIZATION regress_admin; DROP ROLE regress_host_resource_admin; -- ok -- Check that "reassign owned" doesn't affect privileges diff --git a/src/test/modules/unsafe_tests/expected/rolenames.out b/src/test/modules/unsafe_tests/expected/rolenames.out index 61396b2..21d2bac 100644 --- a/src/test/modules/unsafe_tests/expected/rolenames.out +++ b/src/test/modules/unsafe_tests/expected/rolenames.out @@ -1077,7 +1077,7 @@ SHOW session_preload_libraries; SET SESSION AUTHORIZATION regress_role_nopriv; -- fails with role not member of pg_read_all_settings SHOW session_preload_libraries; -ERROR: permission denied to examine "session_preload_libraries" +ERROR: permission denied to examine session_preload_libraries DETAIL: Only roles with privileges of the "pg_read_all_settings" role may examine this parameter. RESET SESSION AUTHORIZATION; ERROR: current transaction is aborted, commands ignored until end of transaction block diff --git a/src/test/regress/expected/compression.out b/src/test/regress/expected/compression.out index 834b755..7426504 100644 --- a/src/test/regress/expected/compression.out +++ b/src/test/regress/expected/compression.out @@ -234,10 +234,10 @@ ERROR: column "f1" has a compression method conflict DETAIL: pglz versus lz4 -- test default_toast_compression GUC SET default_toast_compression = ''; -ERROR: invalid value for parameter "default_toast_compression": "" +ERROR: invalid value for parameter default_toast_compression: "" HINT: Available values: pglz, lz4. SET default_toast_compression = 'I do not exist compression'; -ERROR: invalid value for parameter "default_toast_compression": "I do not exist compression" +ERROR: invalid value for parameter default_toast_compression: "I do not exist compression" HINT: Available values: pglz, lz4. SET default_toast_compression = 'lz4'; SET default_toast_compression = 'pglz'; diff --git a/src/test/regress/expected/compression_1.out b/src/test/regress/expected/compression_1.out index ddcd137..5234e47 100644 --- a/src/test/regress/expected/compression_1.out +++ b/src/test/regress/expected/compression_1.out @@ -225,13 +225,13 @@ ERROR: column "f1" has a compression method conflict DETAIL: pglz versus lz4 -- test default_toast_compression GUC SET default_toast_compression = ''; -ERROR: invalid value for parameter "default_toast_compression": "" +ERROR: invalid value for parameter default_toast_compression: "" HINT: Available values: pglz. SET default_toast_compression = 'I do not exist compression'; -ERROR: invalid value for parameter "default_toast_compression": "I do not exist compression" +ERROR: invalid value for parameter default_toast_compression: "I do not exist compression" HINT: Available values: pglz. SET default_toast_compression = 'lz4'; -ERROR: invalid value for parameter "default_toast_compression": "lz4" +ERROR: invalid value for parameter default_toast_compression: "lz4" HINT: Available values: pglz. SET default_toast_compression = 'pglz'; -- test alter compression method diff --git a/src/test/regress/expected/create_am.out b/src/test/regress/expected/create_am.out index b50293d..afa11a6 100644 --- a/src/test/regress/expected/create_am.out +++ b/src/test/regress/expected/create_am.out @@ -112,11 +112,11 @@ COMMIT; -- -- prevent empty values SET default_table_access_method = ''; -ERROR: invalid value for parameter "default_table_access_method": "" +ERROR: invalid value for parameter default_table_access_method: "" DETAIL: default_table_access_method cannot be empty. -- prevent nonexistent values SET default_table_access_method = 'I do not exist AM'; -ERROR: invalid value for parameter "default_table_access_method": "I do not exist AM" +ERROR: invalid value for parameter default_table_access_method: "I do not exist AM" DETAIL: Table access method "I do not exist AM" does not exist. -- prevent setting it to an index AM SET default_table_access_method = 'btree'; diff --git a/src/test/regress/expected/guc.out b/src/test/regress/expected/guc.out index 127c953..cbf4e8f 100644 --- a/src/test/regress/expected/guc.out +++ b/src/test/regress/expected/guc.out @@ -508,11 +508,11 @@ SELECT '2006-08-13 12:34:56'::timestamptz; -- Test some simple error cases SET seq_page_cost TO 'NaN'; -ERROR: invalid value for parameter "seq_page_cost": "NaN" +ERROR: invalid value for parameter seq_page_cost: "NaN" SET vacuum_cost_delay TO '10s'; -ERROR: 10000 ms is outside the valid range for parameter "vacuum_cost_delay" (0 .. 100) +ERROR: 10000 ms is outside the valid range for parameter vacuum_cost_delay (0 .. 100) SET no_such_variable TO 42; -ERROR: unrecognized configuration parameter "no_such_variable" +ERROR: unrecognized configuration parameter no_such_variable -- Test "custom" GUCs created on the fly (which aren't really an -- intended feature, but many people use them). SHOW custom.my_guc; -- error, not known yet @@ -811,14 +811,14 @@ create function func_with_bad_set() returns int as $$ select 1 $$ language sql set default_text_search_config = no_such_config; NOTICE: text search configuration "no_such_config" does not exist -ERROR: invalid value for parameter "default_text_search_config": "no_such_config" +ERROR: invalid value for parameter default_text_search_config: "no_such_config" set check_function_bodies = off; create function func_with_bad_set() returns int as $$ select 1 $$ language sql set default_text_search_config = no_such_config; NOTICE: text search configuration "no_such_config" does not exist select func_with_bad_set(); -ERROR: invalid value for parameter "default_text_search_config": "no_such_config" +ERROR: invalid value for parameter default_text_search_config: "no_such_config" reset check_function_bodies; set default_with_oids to f; -- Should not allow to set it to true. diff --git a/src/test/regress/expected/password.out b/src/test/regress/expected/password.out index 924d6e0..752cffc 100644 --- a/src/test/regress/expected/password.out +++ b/src/test/regress/expected/password.out @@ -3,10 +3,10 @@ -- -- Tests for GUC password_encryption SET password_encryption = 'novalue'; -- error -ERROR: invalid value for parameter "password_encryption": "novalue" +ERROR: invalid value for parameter password_encryption: "novalue" HINT: Available values: md5, scram-sha-256. SET password_encryption = true; -- error -ERROR: invalid value for parameter "password_encryption": "true" +ERROR: invalid value for parameter password_encryption: "true" HINT: Available values: md5, scram-sha-256. SET password_encryption = 'md5'; -- ok SET password_encryption = 'scram-sha-256'; -- ok diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index b15eddb..8d9229a 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -220,7 +220,7 @@ RESET ROLE; ALTER SUBSCRIPTION regress_testsub RENAME TO regress_testsub_foo; ALTER SUBSCRIPTION regress_testsub_foo SET (synchronous_commit = local); ALTER SUBSCRIPTION regress_testsub_foo SET (synchronous_commit = foobar); -ERROR: invalid value for parameter "synchronous_commit": "foobar" +ERROR: invalid value for parameter synchronous_commit: "foobar" HINT: Available values: local, remote_write, remote_apply, on, off. \dRs+ List of subscriptions diff --git a/src/test/regress/expected/transactions.out b/src/test/regress/expected/transactions.out index 7f5757e..5939ad4 100644 --- a/src/test/regress/expected/transactions.out +++ b/src/test/regress/expected/transactions.out @@ -53,7 +53,7 @@ SELECT COUNT(*) FROM xacttest; (1 row) RESET transaction_isolation; -- error -ERROR: parameter "transaction_isolation" cannot be reset +ERROR: parameter transaction_isolation cannot be reset END; BEGIN TRANSACTION READ ONLY; SELECT COUNT(*) FROM xacttest; @@ -63,7 +63,7 @@ SELECT COUNT(*) FROM xacttest; (1 row) RESET transaction_read_only; -- error -ERROR: parameter "transaction_read_only" cannot be reset +ERROR: parameter transaction_read_only cannot be reset END; BEGIN TRANSACTION DEFERRABLE; SELECT COUNT(*) FROM xacttest; @@ -73,11 +73,11 @@ SELECT COUNT(*) FROM xacttest; (1 row) RESET transaction_deferrable; -- error -ERROR: parameter "transaction_deferrable" cannot be reset +ERROR: parameter transaction_deferrable cannot be reset END; CREATE FUNCTION errfunc() RETURNS int LANGUAGE SQL AS 'SELECT 1' SET transaction_read_only = on; -- error -ERROR: parameter "transaction_read_only" cannot be set locally in functions +ERROR: parameter transaction_read_only cannot be set locally in functions -- Read-only tests CREATE TABLE writetest (a int); CREATE TEMPORARY TABLE temptest (a int); -- 1.8.3.1 ^ permalink raw reply [nested|flat] 21+ messages in thread
* Re: GUC names in messages @ 2023-11-28 00:54 Peter Smith <[email protected]> parent: Peter Smith <[email protected]> 0 siblings, 1 reply; 21+ messages in thread From: Peter Smith @ 2023-11-28 00:54 UTC (permalink / raw) To: Michael Paquier <[email protected]>; +Cc: Alvaro Herrera <[email protected]>; Nathan Bossart <[email protected]>; Laurenz Albe <[email protected]>; Peter Eisentraut <[email protected]>; Tom Lane <[email protected]>; Daniel Gustafsson <[email protected]>; PostgreSQL Hackers <[email protected]> Here is patch set v3. Patches 0001 and 0002 are unchanged from v2. Patch 0003 now uses a "%s%s%s" format specifier with GUC_FORMAT macro in guc.c, as recently suggested by Michael [1]. ~ (Meanwhile, the MixedCase stuff is still an open question, to be addressed in a later patch version) ====== [1] https://www.postgresql.org/message-id/ZWQVxu8zWIx64V7l%40paquier.xyz Kind Regards, Peter Smith. Fujitsu Australia Attachments: [application/octet-stream] v3-0001-GUC-names-docs.patch (1.1K, ../../CAHut+PusWzeZBcOnn07m8TLHJBRiD8HCOV8QPwOwagFv3fs4kA@mail.gmail.com/2-v3-0001-GUC-names-docs.patch) download | inline diff: From 7306abf3fc40f841c252778e7e10009f16c6e16a Mon Sep 17 00:00:00 2001 From: Peter Smith <[email protected]> Date: Tue, 28 Nov 2023 09:32:24 +1100 Subject: [PATCH v3] GUC names - docs --- doc/src/sgml/sources.sgml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml index 06d995e..45ad706 100644 --- a/doc/src/sgml/sources.sgml +++ b/doc/src/sgml/sources.sgml @@ -539,6 +539,14 @@ Hint: The addendum, written as a complete sentence. </para> <para> + In messages containing configuration variable names, do not include quotes + when the names are visibly not English natural words, such as when they + have underscores or are all-uppercase or have mixed case. Otherwise, quotes + must be added. Do include quotes in a message where an arbitrary variable + name is to be expanded. + </para> + + <para> There are functions in the backend that will double-quote their own output as needed (for example, <function>format_type_be()</function>). Do not put additional quotes around the output of such functions. -- 1.8.3.1 [application/octet-stream] v3-0003-GUC-names-maybe-add-quotes.patch (44.0K, ../../CAHut+PusWzeZBcOnn07m8TLHJBRiD8HCOV8QPwOwagFv3fs4kA@mail.gmail.com/3-v3-0003-GUC-names-maybe-add-quotes.patch) download | inline diff: From 255eeb624d6d3493d82cbd152c9c714cc68dad4b Mon Sep 17 00:00:00 2001 From: Peter Smith <[email protected]> Date: Tue, 28 Nov 2023 11:49:04 +1100 Subject: [PATCH v3] GUC names - maybe add quotes --- src/backend/utils/misc/guc.c | 273 ++++++++++++++------- .../test_oat_hooks/expected/test_oat_hooks.out | 4 +- .../modules/unsafe_tests/expected/guc_privs.out | 54 ++-- .../modules/unsafe_tests/expected/rolenames.out | 2 +- src/test/regress/expected/compression.out | 4 +- src/test/regress/expected/compression_1.out | 6 +- src/test/regress/expected/create_am.out | 4 +- src/test/regress/expected/guc.out | 10 +- src/test/regress/expected/password.out | 4 +- src/test/regress/expected/subscription.out | 2 +- src/test/regress/expected/transactions.out | 8 +- 11 files changed, 233 insertions(+), 138 deletions(-) diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index e76c083..248d2cb 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -265,6 +265,45 @@ static bool call_string_check_hook(struct config_string *conf, char **newval, static bool call_enum_check_hook(struct config_enum *conf, int *newval, void **extra, GucSource source, int elevel); +/* Handy macro for adding optional quotes to GUC names during substitution. */ +#define GUC_FORMAT(s)\ + quotes_needed_for_GUC_name(s) ? "\"" : "",\ + s,\ + quotes_needed_for_GUC_name(s) ? "\"" : "" + +/* + * Return whether the GUC name should be enclosed in double-quotes. + * + * Quoting is intended for names which potential could be mistaken for + * normal English words. + * + * - Lowercase alpha needs quotes unless there are underscores + * - Upper/mixed case alpha does not need quotes + * - Anything else needs quotes + */ +static +bool +quotes_needed_for_GUC_name(const char *name) +{ + bool underscore = false; + bool lowercase = false; + bool uppercase = false; + bool other = false; + + for (const char *p = name; *p; p++) + { + if (*p == '_') + underscore = true; + else if ('a' <= *p && *p <= 'z') + lowercase = true; + else if ('A' <= *p && *p <= 'Z') + uppercase = true; + else + other = true; + } + + return other || (lowercase && !underscore && !uppercase); +} /* * This function handles both actual config file (re)loads and execution of @@ -420,8 +459,9 @@ ProcessConfigFileInternal(GucContext context, bool applySettings, int elevel) /* Invalid non-custom variable, so complain */ ereport(elevel, (errcode(ERRCODE_UNDEFINED_OBJECT), - errmsg("unrecognized configuration parameter \"%s\" in file \"%s\" line %d", - item->name, + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("unrecognized configuration parameter %s%s%s in file \"%s\" line %d", + GUC_FORMAT(item->name), item->filename, item->sourceline))); item->errmsg = pstrdup("unrecognized configuration parameter"); error = true; @@ -460,10 +500,13 @@ ProcessConfigFileInternal(GucContext context, bool applySettings, int elevel) gconf->status |= GUC_PENDING_RESTART; ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed without restarting the server", - gconf->name))); - record_config_file_error(psprintf("parameter \"%s\" cannot be changed without restarting the server", - gconf->name), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s cannot be changed without restarting the server", + GUC_FORMAT(gconf->name)))); + record_config_file_error( + /* translator: %s%s%s is for an optionally quoted GUC name */ + psprintf("parameter %s%s%s cannot be changed without restarting the server", + GUC_FORMAT(gconf->name)), NULL, 0, &head, &tail); error = true; @@ -496,8 +539,9 @@ ProcessConfigFileInternal(GucContext context, bool applySettings, int elevel) /* Log the change if appropriate */ if (context == PGC_SIGHUP) ereport(elevel, - (errmsg("parameter \"%s\" removed from configuration file, reset to default", - gconf->name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + (errmsg("parameter %s%s%s removed from configuration file, reset to default", + GUC_FORMAT(gconf->name)))); } } @@ -561,8 +605,10 @@ ProcessConfigFileInternal(GucContext context, bool applySettings, int elevel) post_value = ""; if (strcmp(pre_value, post_value) != 0) ereport(elevel, - (errmsg("parameter \"%s\" changed to \"%s\"", - item->name, item->value))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + (errmsg("parameter %s%s%s changed to \"%s\"", + GUC_FORMAT(item->name), + item->value))); } item->applied = true; } @@ -1129,8 +1175,9 @@ assignable_custom_variable_name(const char *name, bool skip_errors, int elevel) if (!skip_errors) ereport(elevel, (errcode(ERRCODE_INVALID_NAME), - errmsg("invalid configuration parameter name \"%s\"", - name), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid configuration parameter name %s%s%s", + GUC_FORMAT(name)), errdetail("Custom parameter names must be two or more simple identifiers separated by dots."))); return false; } @@ -1145,8 +1192,9 @@ assignable_custom_variable_name(const char *name, bool skip_errors, int elevel) if (!skip_errors) ereport(elevel, (errcode(ERRCODE_INVALID_NAME), - errmsg("invalid configuration parameter name \"%s\"", - name), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid configuration parameter name %s%s%s", + GUC_FORMAT(name)), errdetail("\"%s\" is a reserved prefix.", rcprefix))); return false; @@ -1160,8 +1208,9 @@ assignable_custom_variable_name(const char *name, bool skip_errors, int elevel) if (!skip_errors) ereport(elevel, (errcode(ERRCODE_UNDEFINED_OBJECT), - errmsg("unrecognized configuration parameter \"%s\"", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("unrecognized configuration parameter %s%s%s", + GUC_FORMAT(name)))); return false; } @@ -1270,8 +1319,9 @@ find_option(const char *name, bool create_placeholders, bool skip_errors, if (!skip_errors) ereport(elevel, (errcode(ERRCODE_UNDEFINED_OBJECT), - errmsg("unrecognized configuration parameter \"%s\"", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("unrecognized configuration parameter %s%s%s", + GUC_FORMAT(name)))); return NULL; } @@ -3125,8 +3175,9 @@ parse_and_validate_value(struct config_generic *record, { ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("parameter \"%s\" requires a Boolean value", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s requires a Boolean value", + GUC_FORMAT(name)))); return false; } @@ -3145,8 +3196,9 @@ parse_and_validate_value(struct config_generic *record, { ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("invalid value for parameter \"%s\": \"%s\"", - name, value), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid value for parameter %s%s%s: \"%s\"", + GUC_FORMAT(name), value), hintmsg ? errhint("%s", _(hintmsg)) : 0)); return false; } @@ -3157,11 +3209,12 @@ parse_and_validate_value(struct config_generic *record, ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("%d%s%s is outside the valid range for parameter \"%s\" (%d .. %d)", + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("%d%s%s is outside the valid range for parameter %s%s%s (%d .. %d)", newval->intval, unit ? " " : "", unit ? unit : "", - name, + GUC_FORMAT(name), conf->min, conf->max))); return false; } @@ -3181,8 +3234,9 @@ parse_and_validate_value(struct config_generic *record, { ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("invalid value for parameter \"%s\": \"%s\"", - name, value), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid value for parameter %s%s%s: \"%s\"", + GUC_FORMAT(name), value), hintmsg ? errhint("%s", _(hintmsg)) : 0)); return false; } @@ -3193,11 +3247,12 @@ parse_and_validate_value(struct config_generic *record, ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("%g%s%s is outside the valid range for parameter \"%s\" (%g .. %g)", + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("%g%s%s is outside the valid range for parameter %s%s%s (%g .. %g)", newval->realval, unit ? " " : "", unit ? unit : "", - name, + GUC_FORMAT(name), conf->min, conf->max))); return false; } @@ -3251,8 +3306,9 @@ parse_and_validate_value(struct config_generic *record, ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("invalid value for parameter \"%s\": \"%s\"", - name, value), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid value for parameter %s%s%s: \"%s\"", + GUC_FORMAT(name), value), hintmsg ? errhint("%s", _(hintmsg)) : 0)); if (hintmsg) @@ -3410,8 +3466,9 @@ set_config_option_ext(const char *name, const char *value, { ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s cannot be changed", + GUC_FORMAT(name)))); return 0; } break; @@ -3433,8 +3490,9 @@ set_config_option_ext(const char *name, const char *value, { ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed without restarting the server", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s cannot be changed without restarting the server", + GUC_FORMAT(name)))); return 0; } break; @@ -3443,8 +3501,9 @@ set_config_option_ext(const char *name, const char *value, { ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed now", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s cannot be changed now", + GUC_FORMAT(name)))); return 0; } @@ -3470,8 +3529,9 @@ set_config_option_ext(const char *name, const char *value, /* No granted privilege */ ereport(elevel, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("permission denied to set parameter \"%s\"", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("permission denied to set parameter %s%s%s", + GUC_FORMAT(name)))); return 0; } } @@ -3508,8 +3568,9 @@ set_config_option_ext(const char *name, const char *value, { ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be set after connection start", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s cannot be set after connection start", + GUC_FORMAT(name)))); return 0; } break; @@ -3528,8 +3589,9 @@ set_config_option_ext(const char *name, const char *value, /* No granted privilege */ ereport(elevel, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("permission denied to set parameter \"%s\"", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("permission denied to set parameter %s%s%s", + GUC_FORMAT(name)))); return 0; } } @@ -3567,16 +3629,18 @@ set_config_option_ext(const char *name, const char *value, */ ereport(elevel, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("cannot set parameter \"%s\" within security-definer function", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("cannot set parameter %s%s%s within security-definer function", + GUC_FORMAT(name)))); return 0; } if (InSecurityRestrictedOperation()) { ereport(elevel, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("cannot set parameter \"%s\" within security-restricted operation", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("cannot set parameter %s%s%s within security-restricted operation", + GUC_FORMAT(name)))); return 0; } } @@ -3588,15 +3652,18 @@ set_config_option_ext(const char *name, const char *value, { ereport(elevel, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("parameter \"%s\" cannot be reset", name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s cannot be reset", + GUC_FORMAT(name)))); return 0; } if (action == GUC_ACTION_SAVE) { ereport(elevel, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("parameter \"%s\" cannot be set locally in functions", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s cannot be set locally in functions", + GUC_FORMAT(name)))); return 0; } } @@ -3621,8 +3688,8 @@ set_config_option_ext(const char *name, const char *value, { if (changeVal && !makeDefault) { - elog(DEBUG3, "\"%s\": setting ignored because previous source is higher priority", - name); + elog(DEBUG3, "%s%s%s: setting ignored because previous source is higher priority", + GUC_FORMAT(name)); return -1; } changeVal = false; @@ -3673,8 +3740,9 @@ set_config_option_ext(const char *name, const char *value, record->status |= GUC_PENDING_RESTART; ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed without restarting the server", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s cannot be changed without restarting the server", + GUC_FORMAT(name)))); return 0; } record->status &= ~GUC_PENDING_RESTART; @@ -3771,8 +3839,9 @@ set_config_option_ext(const char *name, const char *value, record->status |= GUC_PENDING_RESTART; ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed without restarting the server", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s cannot be changed without restarting the server", + GUC_FORMAT(name)))); return 0; } record->status &= ~GUC_PENDING_RESTART; @@ -3869,8 +3938,9 @@ set_config_option_ext(const char *name, const char *value, record->status |= GUC_PENDING_RESTART; ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed without restarting the server", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s cannot be changed without restarting the server", + GUC_FORMAT(name)))); return 0; } record->status &= ~GUC_PENDING_RESTART; @@ -3993,8 +4063,9 @@ set_config_option_ext(const char *name, const char *value, record->status |= GUC_PENDING_RESTART; ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed without restarting the server", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s cannot be changed without restarting the server", + GUC_FORMAT(name)))); return 0; } record->status &= ~GUC_PENDING_RESTART; @@ -4096,8 +4167,9 @@ set_config_option_ext(const char *name, const char *value, record->status |= GUC_PENDING_RESTART; ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed without restarting the server", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s cannot be changed without restarting the server", + GUC_FORMAT(name)))); return 0; } record->status &= ~GUC_PENDING_RESTART; @@ -4238,7 +4310,9 @@ GetConfigOption(const char *name, bool missing_ok, bool restrict_privileged) !ConfigOptionIsVisible(record)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("permission denied to examine \"%s\"", name), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("permission denied to examine %s%s%s", + GUC_FORMAT(name)), errdetail("Only roles with privileges of the \"%s\" role may examine this parameter.", "pg_read_all_settings"))); @@ -4534,8 +4608,9 @@ AlterSystemSetConfigFile(AlterSystemStmt *altersysstmt) if (aclresult != ACLCHECK_OK) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("permission denied to set parameter \"%s\"", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("permission denied to set parameter %s%s%s", + GUC_FORMAT(name)))); } } @@ -4559,8 +4634,9 @@ AlterSystemSetConfigFile(AlterSystemStmt *altersysstmt) (record->flags & GUC_DISALLOW_IN_AUTO_FILE)) ereport(ERROR, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s cannot be changed", + GUC_FORMAT(name)))); /* * If a value is specified, verify that it's sane. @@ -4575,8 +4651,9 @@ AlterSystemSetConfigFile(AlterSystemStmt *altersysstmt) &newval, &newextra)) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("invalid value for parameter \"%s\": \"%s\"", - name, value))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid value for parameter %s%s%s: \"%s\"", + GUC_FORMAT(name), value))); if (record->vartype == PGC_STRING && newval.stringval != NULL) guc_free(newval.stringval); @@ -4830,7 +4907,9 @@ define_custom_variable(struct config_generic *variable) if ((hentry->gucvar->flags & GUC_CUSTOM_PLACEHOLDER) == 0) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), - errmsg("attempt to redefine parameter \"%s\"", name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("attempt to redefine parameter %s%s%s", + GUC_FORMAT(name)))); Assert(hentry->gucvar->vartype == PGC_STRING); pHolder = (struct config_string *) hentry->gucvar; @@ -5169,8 +5248,9 @@ MarkGUCPrefixReserved(const char *className) { ereport(WARNING, (errcode(ERRCODE_INVALID_NAME), - errmsg("invalid configuration parameter name \"%s\", removing it", - var->name), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid configuration parameter name %s%s%s, removing it", + GUC_FORMAT(var->name)), errdetail("\"%s\" is now a reserved prefix.", className))); /* Remove it from the hash table */ @@ -5313,7 +5393,9 @@ GetConfigOptionByName(const char *name, const char **varname, bool missing_ok) if (!ConfigOptionIsVisible(record)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("permission denied to examine \"%s\"", name), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("permission denied to examine %s%s%s", + GUC_FORMAT(name)), errdetail("Only roles with privileges of the \"%s\" role may examine this parameter.", "pg_read_all_settings"))); @@ -5639,7 +5721,8 @@ read_nondefault_variables(void) break; if (find_option(varname, true, false, FATAL) == NULL) - elog(FATAL, "failed to locate variable \"%s\" in exec config params file", varname); + elog(FATAL, "failed to locate variable %s%s%s in exec config params file", + GUC_FORMAT(varname)); if ((varvalue = read_string_with_null(fp)) == NULL) elog(FATAL, "invalid format of exec config params file"); @@ -6048,8 +6131,9 @@ guc_restore_error_context_callback(void *arg) char **error_context_name_and_value = (char **) arg; if (error_context_name_and_value) - errcontext("while setting parameter \"%s\" to \"%s\"", - error_context_name_and_value[0], + /* translator: %s%s%s is for an optionally quoted GUC name */ + errcontext("while setting parameter %s%s%s to \"%s\"", + GUC_FORMAT(error_context_name_and_value[0]), error_context_name_and_value[1]); } @@ -6217,7 +6301,9 @@ RestoreGUCState(void *gucstate) if (result <= 0) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), - errmsg("parameter \"%s\" could not be set", varname))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s could not be set", + GUC_FORMAT(varname)))); if (varsourcefile[0]) set_config_sourcefile(varname, varsourcefile, varsourceline); error_context_callback.arg = NULL; @@ -6307,8 +6393,9 @@ TransformGUCArray(ArrayType *array, List **names, List **values) { ereport(WARNING, (errcode(ERRCODE_SYNTAX_ERROR), - errmsg("could not parse setting for parameter \"%s\"", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("could not parse setting for parameter %s%s%s", + GUC_FORMAT(name)))); pfree(name); continue; } @@ -6625,7 +6712,9 @@ validate_option_array_item(const char *name, const char *value, return false; ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("permission denied to set parameter \"%s\"", name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("permission denied to set parameter %s%s%s", + GUC_FORMAT(name)))); } /* manual permissions check so we can avoid an error being thrown */ @@ -6689,8 +6778,9 @@ call_bool_check_hook(struct config_bool *conf, bool *newval, void **extra, (errcode(GUC_check_errcode_value), GUC_check_errmsg_string ? errmsg_internal("%s", GUC_check_errmsg_string) : - errmsg("invalid value for parameter \"%s\": %d", - conf->gen.name, (int) *newval), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid value for parameter %s%s%s: %d", + GUC_FORMAT(conf->gen.name), (int) *newval), GUC_check_errdetail_string ? errdetail_internal("%s", GUC_check_errdetail_string) : 0, GUC_check_errhint_string ? @@ -6723,8 +6813,9 @@ call_int_check_hook(struct config_int *conf, int *newval, void **extra, (errcode(GUC_check_errcode_value), GUC_check_errmsg_string ? errmsg_internal("%s", GUC_check_errmsg_string) : - errmsg("invalid value for parameter \"%s\": %d", - conf->gen.name, *newval), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid value for parameter %s%s%s: %d", + GUC_FORMAT(conf->gen.name), *newval), GUC_check_errdetail_string ? errdetail_internal("%s", GUC_check_errdetail_string) : 0, GUC_check_errhint_string ? @@ -6757,8 +6848,9 @@ call_real_check_hook(struct config_real *conf, double *newval, void **extra, (errcode(GUC_check_errcode_value), GUC_check_errmsg_string ? errmsg_internal("%s", GUC_check_errmsg_string) : - errmsg("invalid value for parameter \"%s\": %g", - conf->gen.name, *newval), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid value for parameter %s%s%s: %g", + GUC_FORMAT(conf->gen.name), *newval), GUC_check_errdetail_string ? errdetail_internal("%s", GUC_check_errdetail_string) : 0, GUC_check_errhint_string ? @@ -6800,8 +6892,10 @@ call_string_check_hook(struct config_string *conf, char **newval, void **extra, (errcode(GUC_check_errcode_value), GUC_check_errmsg_string ? errmsg_internal("%s", GUC_check_errmsg_string) : - errmsg("invalid value for parameter \"%s\": \"%s\"", - conf->gen.name, *newval ? *newval : ""), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid value for parameter %s%s%s: \"%s\"", + GUC_FORMAT(conf->gen.name), + *newval ? *newval : ""), GUC_check_errdetail_string ? errdetail_internal("%s", GUC_check_errdetail_string) : 0, GUC_check_errhint_string ? @@ -6841,8 +6935,9 @@ call_enum_check_hook(struct config_enum *conf, int *newval, void **extra, (errcode(GUC_check_errcode_value), GUC_check_errmsg_string ? errmsg_internal("%s", GUC_check_errmsg_string) : - errmsg("invalid value for parameter \"%s\": \"%s\"", - conf->gen.name, + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid value for parameter %s%s%s: \"%s\"", + GUC_FORMAT(conf->gen.name), config_enum_lookup_by_value(conf, *newval)), GUC_check_errdetail_string ? errdetail_internal("%s", GUC_check_errdetail_string) : 0, diff --git a/src/test/modules/test_oat_hooks/expected/test_oat_hooks.out b/src/test/modules/test_oat_hooks/expected/test_oat_hooks.out index f80373a..ccaa65e 100644 --- a/src/test/modules/test_oat_hooks/expected/test_oat_hooks.out +++ b/src/test/modules/test_oat_hooks/expected/test_oat_hooks.out @@ -180,10 +180,10 @@ NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, NOTICE: in process utility: non-superuser finished RESET ALTER SYSTEM SET work_mem = 8192; NOTICE: in process utility: non-superuser attempting ALTER SYSTEM -ERROR: permission denied to set parameter "work_mem" +ERROR: permission denied to set parameter work_mem ALTER SYSTEM RESET work_mem; NOTICE: in process utility: non-superuser attempting ALTER SYSTEM -ERROR: permission denied to set parameter "work_mem" +ERROR: permission denied to set parameter work_mem SET test_oat_hooks.user_var1 = true; NOTICE: in process utility: non-superuser attempting SET NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [test_oat_hooks.user_var1] diff --git a/src/test/modules/unsafe_tests/expected/guc_privs.out b/src/test/modules/unsafe_tests/expected/guc_privs.out index 6c0ad89..5ed2113 100644 --- a/src/test/modules/unsafe_tests/expected/guc_privs.out +++ b/src/test/modules/unsafe_tests/expected/guc_privs.out @@ -8,31 +8,31 @@ CREATE ROLE regress_admin SUPERUSER; SET SESSION AUTHORIZATION regress_admin; -- PGC_BACKEND SET ignore_system_indexes = OFF; -- fail, cannot be set after connection start -ERROR: parameter "ignore_system_indexes" cannot be set after connection start +ERROR: parameter ignore_system_indexes cannot be set after connection start RESET ignore_system_indexes; -- fail, cannot be set after connection start -ERROR: parameter "ignore_system_indexes" cannot be set after connection start +ERROR: parameter ignore_system_indexes cannot be set after connection start ALTER SYSTEM SET ignore_system_indexes = OFF; -- ok ALTER SYSTEM RESET ignore_system_indexes; -- ok -- PGC_INTERNAL SET block_size = 50; -- fail, cannot be changed -ERROR: parameter "block_size" cannot be changed +ERROR: parameter block_size cannot be changed RESET block_size; -- fail, cannot be changed -ERROR: parameter "block_size" cannot be changed +ERROR: parameter block_size cannot be changed ALTER SYSTEM SET block_size = 50; -- fail, cannot be changed -ERROR: parameter "block_size" cannot be changed +ERROR: parameter block_size cannot be changed ALTER SYSTEM RESET block_size; -- fail, cannot be changed -ERROR: parameter "block_size" cannot be changed +ERROR: parameter block_size cannot be changed -- PGC_POSTMASTER SET autovacuum_freeze_max_age = 1000050000; -- fail, requires restart -ERROR: parameter "autovacuum_freeze_max_age" cannot be changed without restarting the server +ERROR: parameter autovacuum_freeze_max_age cannot be changed without restarting the server RESET autovacuum_freeze_max_age; -- fail, requires restart -ERROR: parameter "autovacuum_freeze_max_age" cannot be changed without restarting the server +ERROR: parameter autovacuum_freeze_max_age cannot be changed without restarting the server ALTER SYSTEM SET autovacuum_freeze_max_age = 1000050000; -- ok ALTER SYSTEM RESET autovacuum_freeze_max_age; -- ok ALTER SYSTEM SET config_file = '/usr/local/data/postgresql.conf'; -- fail, cannot be changed -ERROR: parameter "config_file" cannot be changed +ERROR: parameter config_file cannot be changed ALTER SYSTEM RESET config_file; -- fail, cannot be changed -ERROR: parameter "config_file" cannot be changed +ERROR: parameter config_file cannot be changed -- PGC_SIGHUP SET autovacuum = OFF; -- fail, requires reload ERROR: parameter "autovacuum" cannot be changed now @@ -47,9 +47,9 @@ ALTER SYSTEM SET lc_messages = 'C'; -- ok ALTER SYSTEM RESET lc_messages; -- ok -- PGC_SU_BACKEND SET jit_debugging_support = OFF; -- fail, cannot be set after connection start -ERROR: parameter "jit_debugging_support" cannot be set after connection start +ERROR: parameter jit_debugging_support cannot be set after connection start RESET jit_debugging_support; -- fail, cannot be set after connection start -ERROR: parameter "jit_debugging_support" cannot be set after connection start +ERROR: parameter jit_debugging_support cannot be set after connection start ALTER SYSTEM SET jit_debugging_support = OFF; -- ok ALTER SYSTEM RESET jit_debugging_support; -- ok -- PGC_USERSET @@ -58,9 +58,9 @@ RESET DateStyle; -- ok ALTER SYSTEM SET DateStyle = 'ISO, MDY'; -- ok ALTER SYSTEM RESET DateStyle; -- ok ALTER SYSTEM SET ssl_renegotiation_limit = 0; -- fail, cannot be changed -ERROR: parameter "ssl_renegotiation_limit" cannot be changed +ERROR: parameter ssl_renegotiation_limit cannot be changed ALTER SYSTEM RESET ssl_renegotiation_limit; -- fail, cannot be changed -ERROR: parameter "ssl_renegotiation_limit" cannot be changed +ERROR: parameter ssl_renegotiation_limit cannot be changed -- Finished testing superuser -- Create non-superuser with privileges to configure host resource usage CREATE ROLE regress_host_resource_admin NOSUPERUSER; @@ -244,7 +244,7 @@ SHOW none.such; -- Can't grant on a non-existent core GUC. GRANT ALL ON PARAMETER no_such_guc TO regress_host_resource_admin; -- fail -ERROR: unrecognized configuration parameter "no_such_guc" +ERROR: unrecognized configuration parameter no_such_guc -- Initially there are no privileges and no catalog entry for this GUC. SELECT has_parameter_privilege('regress_host_resource_admin', 'enable_material', 'SET'); has_parameter_privilege @@ -446,17 +446,17 @@ ALTER ROLE regress_host_resource_admin SET lc_messages = 'C'; SET SESSION AUTHORIZATION regress_host_resource_admin; ALTER SYSTEM SET autovacuum_work_mem = 32; -- ok, privileges have been granted ALTER SYSTEM SET ignore_system_indexes = OFF; -- fail, insufficient privileges -ERROR: permission denied to set parameter "ignore_system_indexes" +ERROR: permission denied to set parameter ignore_system_indexes ALTER SYSTEM RESET autovacuum_multixact_freeze_max_age; -- fail, insufficient privileges -ERROR: permission denied to set parameter "autovacuum_multixact_freeze_max_age" +ERROR: permission denied to set parameter autovacuum_multixact_freeze_max_age SET jit_provider = 'llvmjit'; -- fail, insufficient privileges -ERROR: parameter "jit_provider" cannot be changed without restarting the server +ERROR: parameter jit_provider cannot be changed without restarting the server SELECT set_config ('jit_provider', 'llvmjit', true); -- fail, insufficient privileges -ERROR: parameter "jit_provider" cannot be changed without restarting the server +ERROR: parameter jit_provider cannot be changed without restarting the server ALTER SYSTEM SET shared_buffers = 50; -- ok ALTER SYSTEM RESET shared_buffers; -- ok SET autovacuum_work_mem = 50; -- cannot be changed now -ERROR: parameter "autovacuum_work_mem" cannot be changed now +ERROR: parameter autovacuum_work_mem cannot be changed now ALTER SYSTEM RESET temp_file_limit; -- ok SET TimeZone = 'Europe/Helsinki'; -- ok RESET TimeZone; -- ok @@ -465,13 +465,13 @@ RESET max_stack_depth; -- ok, privileges have been granted ALTER SYSTEM SET max_stack_depth = '100kB'; -- ok, privileges have been granted ALTER SYSTEM RESET max_stack_depth; -- ok, privileges have been granted SET lc_messages = 'C'; -- fail, insufficient privileges -ERROR: permission denied to set parameter "lc_messages" +ERROR: permission denied to set parameter lc_messages RESET lc_messages; -- fail, insufficient privileges -ERROR: permission denied to set parameter "lc_messages" +ERROR: permission denied to set parameter lc_messages ALTER SYSTEM SET lc_messages = 'C'; -- fail, insufficient privileges -ERROR: permission denied to set parameter "lc_messages" +ERROR: permission denied to set parameter lc_messages ALTER SYSTEM RESET lc_messages; -- fail, insufficient privileges -ERROR: permission denied to set parameter "lc_messages" +ERROR: permission denied to set parameter lc_messages SELECT set_config ('temp_buffers', '8192', false); -- ok set_config ------------ @@ -484,7 +484,7 @@ ERROR: permission denied to perform ALTER SYSTEM RESET ALL ALTER SYSTEM SET none.such2 = 'whiz bang'; -- fail, not superuser ERROR: permission denied to set parameter "none.such2" ALTER ROLE regress_host_resource_admin SET lc_messages = 'POSIX'; -- fail -ERROR: permission denied to set parameter "lc_messages" +ERROR: permission denied to set parameter lc_messages ALTER ROLE regress_host_resource_admin SET max_stack_depth = '1MB'; -- ok SELECT setconfig FROM pg_db_role_setting WHERE setrole = 'regress_host_resource_admin'::regrole; @@ -537,7 +537,7 @@ DROP ROLE regress_host_resource_admin; -- ok CREATE ROLE regress_host_resource_admin NOSUPERUSER; SET SESSION AUTHORIZATION regress_host_resource_admin; ALTER SYSTEM SET autovacuum_work_mem = 32; -- fail, privileges not yet granted -ERROR: permission denied to set parameter "autovacuum_work_mem" +ERROR: permission denied to set parameter autovacuum_work_mem SET SESSION AUTHORIZATION regress_admin; GRANT SET, ALTER SYSTEM ON PARAMETER autovacuum_work_mem, hash_mem_multiplier, max_stack_depth, @@ -554,7 +554,7 @@ privileges for parameter work_mem DROP OWNED BY regress_host_resource_admin RESTRICT; -- cascade should not be needed SET SESSION AUTHORIZATION regress_host_resource_admin; ALTER SYSTEM SET autovacuum_work_mem = 32; -- fail, "drop owned" has dropped privileges -ERROR: permission denied to set parameter "autovacuum_work_mem" +ERROR: permission denied to set parameter autovacuum_work_mem SET SESSION AUTHORIZATION regress_admin; DROP ROLE regress_host_resource_admin; -- ok -- Check that "reassign owned" doesn't affect privileges diff --git a/src/test/modules/unsafe_tests/expected/rolenames.out b/src/test/modules/unsafe_tests/expected/rolenames.out index 61396b2..21d2bac 100644 --- a/src/test/modules/unsafe_tests/expected/rolenames.out +++ b/src/test/modules/unsafe_tests/expected/rolenames.out @@ -1077,7 +1077,7 @@ SHOW session_preload_libraries; SET SESSION AUTHORIZATION regress_role_nopriv; -- fails with role not member of pg_read_all_settings SHOW session_preload_libraries; -ERROR: permission denied to examine "session_preload_libraries" +ERROR: permission denied to examine session_preload_libraries DETAIL: Only roles with privileges of the "pg_read_all_settings" role may examine this parameter. RESET SESSION AUTHORIZATION; ERROR: current transaction is aborted, commands ignored until end of transaction block diff --git a/src/test/regress/expected/compression.out b/src/test/regress/expected/compression.out index 834b755..7426504 100644 --- a/src/test/regress/expected/compression.out +++ b/src/test/regress/expected/compression.out @@ -234,10 +234,10 @@ ERROR: column "f1" has a compression method conflict DETAIL: pglz versus lz4 -- test default_toast_compression GUC SET default_toast_compression = ''; -ERROR: invalid value for parameter "default_toast_compression": "" +ERROR: invalid value for parameter default_toast_compression: "" HINT: Available values: pglz, lz4. SET default_toast_compression = 'I do not exist compression'; -ERROR: invalid value for parameter "default_toast_compression": "I do not exist compression" +ERROR: invalid value for parameter default_toast_compression: "I do not exist compression" HINT: Available values: pglz, lz4. SET default_toast_compression = 'lz4'; SET default_toast_compression = 'pglz'; diff --git a/src/test/regress/expected/compression_1.out b/src/test/regress/expected/compression_1.out index ddcd137..5234e47 100644 --- a/src/test/regress/expected/compression_1.out +++ b/src/test/regress/expected/compression_1.out @@ -225,13 +225,13 @@ ERROR: column "f1" has a compression method conflict DETAIL: pglz versus lz4 -- test default_toast_compression GUC SET default_toast_compression = ''; -ERROR: invalid value for parameter "default_toast_compression": "" +ERROR: invalid value for parameter default_toast_compression: "" HINT: Available values: pglz. SET default_toast_compression = 'I do not exist compression'; -ERROR: invalid value for parameter "default_toast_compression": "I do not exist compression" +ERROR: invalid value for parameter default_toast_compression: "I do not exist compression" HINT: Available values: pglz. SET default_toast_compression = 'lz4'; -ERROR: invalid value for parameter "default_toast_compression": "lz4" +ERROR: invalid value for parameter default_toast_compression: "lz4" HINT: Available values: pglz. SET default_toast_compression = 'pglz'; -- test alter compression method diff --git a/src/test/regress/expected/create_am.out b/src/test/regress/expected/create_am.out index b50293d..afa11a6 100644 --- a/src/test/regress/expected/create_am.out +++ b/src/test/regress/expected/create_am.out @@ -112,11 +112,11 @@ COMMIT; -- -- prevent empty values SET default_table_access_method = ''; -ERROR: invalid value for parameter "default_table_access_method": "" +ERROR: invalid value for parameter default_table_access_method: "" DETAIL: default_table_access_method cannot be empty. -- prevent nonexistent values SET default_table_access_method = 'I do not exist AM'; -ERROR: invalid value for parameter "default_table_access_method": "I do not exist AM" +ERROR: invalid value for parameter default_table_access_method: "I do not exist AM" DETAIL: Table access method "I do not exist AM" does not exist. -- prevent setting it to an index AM SET default_table_access_method = 'btree'; diff --git a/src/test/regress/expected/guc.out b/src/test/regress/expected/guc.out index 127c953..cbf4e8f 100644 --- a/src/test/regress/expected/guc.out +++ b/src/test/regress/expected/guc.out @@ -508,11 +508,11 @@ SELECT '2006-08-13 12:34:56'::timestamptz; -- Test some simple error cases SET seq_page_cost TO 'NaN'; -ERROR: invalid value for parameter "seq_page_cost": "NaN" +ERROR: invalid value for parameter seq_page_cost: "NaN" SET vacuum_cost_delay TO '10s'; -ERROR: 10000 ms is outside the valid range for parameter "vacuum_cost_delay" (0 .. 100) +ERROR: 10000 ms is outside the valid range for parameter vacuum_cost_delay (0 .. 100) SET no_such_variable TO 42; -ERROR: unrecognized configuration parameter "no_such_variable" +ERROR: unrecognized configuration parameter no_such_variable -- Test "custom" GUCs created on the fly (which aren't really an -- intended feature, but many people use them). SHOW custom.my_guc; -- error, not known yet @@ -811,14 +811,14 @@ create function func_with_bad_set() returns int as $$ select 1 $$ language sql set default_text_search_config = no_such_config; NOTICE: text search configuration "no_such_config" does not exist -ERROR: invalid value for parameter "default_text_search_config": "no_such_config" +ERROR: invalid value for parameter default_text_search_config: "no_such_config" set check_function_bodies = off; create function func_with_bad_set() returns int as $$ select 1 $$ language sql set default_text_search_config = no_such_config; NOTICE: text search configuration "no_such_config" does not exist select func_with_bad_set(); -ERROR: invalid value for parameter "default_text_search_config": "no_such_config" +ERROR: invalid value for parameter default_text_search_config: "no_such_config" reset check_function_bodies; set default_with_oids to f; -- Should not allow to set it to true. diff --git a/src/test/regress/expected/password.out b/src/test/regress/expected/password.out index 924d6e0..752cffc 100644 --- a/src/test/regress/expected/password.out +++ b/src/test/regress/expected/password.out @@ -3,10 +3,10 @@ -- -- Tests for GUC password_encryption SET password_encryption = 'novalue'; -- error -ERROR: invalid value for parameter "password_encryption": "novalue" +ERROR: invalid value for parameter password_encryption: "novalue" HINT: Available values: md5, scram-sha-256. SET password_encryption = true; -- error -ERROR: invalid value for parameter "password_encryption": "true" +ERROR: invalid value for parameter password_encryption: "true" HINT: Available values: md5, scram-sha-256. SET password_encryption = 'md5'; -- ok SET password_encryption = 'scram-sha-256'; -- ok diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index b15eddb..8d9229a 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -220,7 +220,7 @@ RESET ROLE; ALTER SUBSCRIPTION regress_testsub RENAME TO regress_testsub_foo; ALTER SUBSCRIPTION regress_testsub_foo SET (synchronous_commit = local); ALTER SUBSCRIPTION regress_testsub_foo SET (synchronous_commit = foobar); -ERROR: invalid value for parameter "synchronous_commit": "foobar" +ERROR: invalid value for parameter synchronous_commit: "foobar" HINT: Available values: local, remote_write, remote_apply, on, off. \dRs+ List of subscriptions diff --git a/src/test/regress/expected/transactions.out b/src/test/regress/expected/transactions.out index 7f5757e..5939ad4 100644 --- a/src/test/regress/expected/transactions.out +++ b/src/test/regress/expected/transactions.out @@ -53,7 +53,7 @@ SELECT COUNT(*) FROM xacttest; (1 row) RESET transaction_isolation; -- error -ERROR: parameter "transaction_isolation" cannot be reset +ERROR: parameter transaction_isolation cannot be reset END; BEGIN TRANSACTION READ ONLY; SELECT COUNT(*) FROM xacttest; @@ -63,7 +63,7 @@ SELECT COUNT(*) FROM xacttest; (1 row) RESET transaction_read_only; -- error -ERROR: parameter "transaction_read_only" cannot be reset +ERROR: parameter transaction_read_only cannot be reset END; BEGIN TRANSACTION DEFERRABLE; SELECT COUNT(*) FROM xacttest; @@ -73,11 +73,11 @@ SELECT COUNT(*) FROM xacttest; (1 row) RESET transaction_deferrable; -- error -ERROR: parameter "transaction_deferrable" cannot be reset +ERROR: parameter transaction_deferrable cannot be reset END; CREATE FUNCTION errfunc() RETURNS int LANGUAGE SQL AS 'SELECT 1' SET transaction_read_only = on; -- error -ERROR: parameter "transaction_read_only" cannot be set locally in functions +ERROR: parameter transaction_read_only cannot be set locally in functions -- Read-only tests CREATE TABLE writetest (a int); CREATE TEMPORARY TABLE temptest (a int); -- 1.8.3.1 [application/octet-stream] v3-0002-GUC-names-fix-quotes.patch (29.9K, ../../CAHut+PusWzeZBcOnn07m8TLHJBRiD8HCOV8QPwOwagFv3fs4kA@mail.gmail.com/4-v3-0002-GUC-names-fix-quotes.patch) download | inline diff: From 8e67473089e2e3b914aced9763924fbb83c9edc4 Mon Sep 17 00:00:00 2001 From: Peter Smith <[email protected]> Date: Tue, 28 Nov 2023 09:32:49 +1100 Subject: [PATCH v3] GUC names - fix quotes --- contrib/pg_prewarm/autoprewarm.c | 2 +- src/backend/access/heap/vacuumlazy.c | 2 +- src/backend/access/transam/commit_ts.c | 4 +- src/backend/access/transam/xlog.c | 4 +- src/backend/commands/vacuum.c | 2 +- src/backend/commands/variable.c | 4 +- src/backend/libpq/be-secure-openssl.c | 6 +-- src/backend/postmaster/bgworker.c | 2 +- src/backend/postmaster/checkpointer.c | 2 +- src/backend/postmaster/pgarch.c | 2 +- src/backend/storage/buffer/localbuf.c | 2 +- src/backend/storage/file/fd.c | 2 +- src/backend/storage/lmgr/predicate.c | 2 +- src/backend/tcop/postgres.c | 10 ++--- src/backend/utils/adt/datetime.c | 2 +- src/backend/utils/adt/pg_locale.c | 4 +- src/backend/utils/fmgr/dfmgr.c | 4 +- src/backend/utils/misc/guc.c | 2 +- src/backend/utils/misc/guc_tables.c | 4 +- src/test/regress/expected/collate.icu.utf8.out | 4 +- src/test/regress/expected/date.out | 58 +++++++++++++------------- src/test/regress/expected/horology.out | 2 +- src/test/regress/expected/json.out | 4 +- src/test/regress/expected/jsonb.out | 4 +- 24 files changed, 67 insertions(+), 67 deletions(-) diff --git a/contrib/pg_prewarm/autoprewarm.c b/contrib/pg_prewarm/autoprewarm.c index d0efc9e..0993bd2 100644 --- a/contrib/pg_prewarm/autoprewarm.c +++ b/contrib/pg_prewarm/autoprewarm.c @@ -877,7 +877,7 @@ apw_start_database_worker(void) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_RESOURCES), errmsg("registering dynamic bgworker autoprewarm failed"), - errhint("Consider increasing configuration parameter \"max_worker_processes\"."))); + errhint("Consider increasing configuration parameter max_worker_processes."))); /* * Ignore return value; if it fails, postmaster has died, but we have diff --git a/src/backend/access/heap/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c index 59f51f4..3b9299b 100644 --- a/src/backend/access/heap/vacuumlazy.c +++ b/src/backend/access/heap/vacuumlazy.c @@ -2658,7 +2658,7 @@ lazy_check_wraparound_failsafe(LVRelState *vacrel) vacrel->dbname, vacrel->relnamespace, vacrel->relname, vacrel->num_index_scans), errdetail("The table's relfrozenxid or relminmxid is too far in the past."), - errhint("Consider increasing configuration parameter \"maintenance_work_mem\" or \"autovacuum_work_mem\".\n" + errhint("Consider increasing configuration parameter maintenance_work_mem or autovacuum_work_mem.\n" "You might also need to consider other ways for VACUUM to keep up with the allocation of transaction IDs."))); /* Stop applying cost limits from this point on */ diff --git a/src/backend/access/transam/commit_ts.c b/src/backend/access/transam/commit_ts.c index b897fab..9385790 100644 --- a/src/backend/access/transam/commit_ts.c +++ b/src/backend/access/transam/commit_ts.c @@ -376,9 +376,9 @@ error_commit_ts_disabled(void) (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), errmsg("could not get commit timestamp data"), RecoveryInProgress() ? - errhint("Make sure the configuration parameter \"%s\" is set on the primary server.", + errhint("Make sure the configuration parameter %s is set on the primary server.", "track_commit_timestamp") : - errhint("Make sure the configuration parameter \"%s\" is set.", + errhint("Make sure the configuration parameter %s is set.", "track_commit_timestamp"))); } diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index ef9b8e4..b0d4ae3 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -4245,11 +4245,11 @@ ReadControlFile(void) /* check and update variables dependent on wal_segment_size */ if (ConvertToXSegs(min_wal_size_mb, wal_segment_size) < 2) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("\"min_wal_size\" must be at least twice \"wal_segment_size\""))); + errmsg("min_wal_size must be at least twice wal_segment_size"))); if (ConvertToXSegs(max_wal_size_mb, wal_segment_size) < 2) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("\"max_wal_size\" must be at least twice \"wal_segment_size\""))); + errmsg("max_wal_size must be at least twice wal_segment_size"))); UsableBytesInSegment = (wal_segment_size / XLOG_BLCKSZ * UsableBytesInPage) - diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index 8bdbee6..be43b46 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -134,7 +134,7 @@ check_vacuum_buffer_usage_limit(int *newval, void **extra, return true; /* Value does not fall within any allowable range */ - GUC_check_errdetail("\"vacuum_buffer_usage_limit\" must be 0 or between %d kB and %d kB", + GUC_check_errdetail("vacuum_buffer_usage_limit must be 0 or between %d kB and %d kB", MIN_BAS_VAC_RING_SIZE_KB, MAX_BAS_VAC_RING_SIZE_KB); return false; diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c index a88cf5f..2703d2e 100644 --- a/src/backend/commands/variable.c +++ b/src/backend/commands/variable.c @@ -182,7 +182,7 @@ check_datestyle(char **newval, void **extra, GucSource source) if (!ok) { - GUC_check_errdetail("Conflicting \"datestyle\" specifications."); + GUC_check_errdetail("Conflicting DateStyle specifications."); return false; } @@ -717,7 +717,7 @@ check_client_encoding(char **newval, void **extra, GucSource source) else { /* Provide a useful complaint */ - GUC_check_errdetail("Cannot change \"client_encoding\" now."); + GUC_check_errdetail("Cannot change client_encoding now."); } return false; } diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c index 31b6a6e..e715fee 100644 --- a/src/backend/libpq/be-secure-openssl.c +++ b/src/backend/libpq/be-secure-openssl.c @@ -195,7 +195,7 @@ be_tls_init(bool isServerStart) { ereport(isServerStart ? FATAL : LOG, /*- translator: first %s is a GUC option name, second %s is its value */ - (errmsg("\"%s\" setting \"%s\" not supported by this build", + (errmsg("%s setting \"%s\" not supported by this build", "ssl_min_protocol_version", GetConfigOption("ssl_min_protocol_version", false, false)))); @@ -218,7 +218,7 @@ be_tls_init(bool isServerStart) { ereport(isServerStart ? FATAL : LOG, /*- translator: first %s is a GUC option name, second %s is its value */ - (errmsg("\"%s\" setting \"%s\" not supported by this build", + (errmsg("%s setting \"%s\" not supported by this build", "ssl_max_protocol_version", GetConfigOption("ssl_max_protocol_version", false, false)))); @@ -245,7 +245,7 @@ be_tls_init(bool isServerStart) { ereport(isServerStart ? FATAL : LOG, (errmsg("could not set SSL protocol version range"), - errdetail("\"%s\" cannot be higher than \"%s\"", + errdetail("%s cannot be higher than %s", "ssl_min_protocol_version", "ssl_max_protocol_version"))); goto error; diff --git a/src/backend/postmaster/bgworker.c b/src/backend/postmaster/bgworker.c index 48a9924..911bf24 100644 --- a/src/backend/postmaster/bgworker.c +++ b/src/backend/postmaster/bgworker.c @@ -944,7 +944,7 @@ RegisterBackgroundWorker(BackgroundWorker *worker) "Up to %d background workers can be registered with the current settings.", max_worker_processes, max_worker_processes), - errhint("Consider increasing the configuration parameter \"max_worker_processes\"."))); + errhint("Consider increasing the configuration parameter max_worker_processes."))); return; } diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c index 42c807d..dc2da5a 100644 --- a/src/backend/postmaster/checkpointer.c +++ b/src/backend/postmaster/checkpointer.c @@ -423,7 +423,7 @@ CheckpointerMain(void) "checkpoints are occurring too frequently (%d seconds apart)", elapsed_secs, elapsed_secs), - errhint("Consider increasing the configuration parameter \"max_wal_size\"."))); + errhint("Consider increasing the configuration parameter max_wal_size."))); /* * Initialize checkpointer-private variables used during diff --git a/src/backend/postmaster/pgarch.c b/src/backend/postmaster/pgarch.c index 46af349..a2555e8 100644 --- a/src/backend/postmaster/pgarch.c +++ b/src/backend/postmaster/pgarch.c @@ -807,7 +807,7 @@ HandlePgArchInterrupts(void) */ ereport(LOG, (errmsg("restarting archiver process because value of " - "\"archive_library\" was changed"))); + "archive_library was changed"))); proc_exit(0); } diff --git a/src/backend/storage/buffer/localbuf.c b/src/backend/storage/buffer/localbuf.c index 4efb34b..aebcf14 100644 --- a/src/backend/storage/buffer/localbuf.c +++ b/src/backend/storage/buffer/localbuf.c @@ -705,7 +705,7 @@ check_temp_buffers(int *newval, void **extra, GucSource source) */ if (source != PGC_S_TEST && NLocBuffer && NLocBuffer != *newval) { - GUC_check_errdetail("\"temp_buffers\" cannot be changed after any temporary tables have been accessed in the session."); + GUC_check_errdetail("temp_buffers cannot be changed after any temporary tables have been accessed in the session."); return false; } return true; diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c index f691ba0..a185fb3 100644 --- a/src/backend/storage/file/fd.c +++ b/src/backend/storage/file/fd.c @@ -3931,7 +3931,7 @@ check_debug_io_direct(char **newval, void **extra, GucSource source) if (!SplitGUCList(rawstring, ',', &elemlist)) { - GUC_check_errdetail("invalid list syntax in parameter \"%s\"", + GUC_check_errdetail("invalid list syntax in parameter %s", "debug_io_direct"); pfree(rawstring); list_free(elemlist); diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c index a794546..f1f6d0c 100644 --- a/src/backend/storage/lmgr/predicate.c +++ b/src/backend/storage/lmgr/predicate.c @@ -1643,7 +1643,7 @@ GetSerializableTransactionSnapshot(Snapshot snapshot) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("cannot use serializable mode in a hot standby"), - errdetail("\"default_transaction_isolation\" is set to \"serializable\"."), + errdetail("default_transaction_isolation is set to \"serializable\"."), errhint("You can use \"SET default_transaction_isolation = 'repeatable read'\" to change the default."))); /* diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index e415cf1..7298a18 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -3524,7 +3524,7 @@ check_stack_depth(void) ereport(ERROR, (errcode(ERRCODE_STATEMENT_TOO_COMPLEX), errmsg("stack depth limit exceeded"), - errhint("Increase the configuration parameter \"max_stack_depth\" (currently %dkB), " + errhint("Increase the configuration parameter max_stack_depth (currently %dkB), " "after ensuring the platform's stack depth limit is adequate.", max_stack_depth))); } @@ -3571,7 +3571,7 @@ check_max_stack_depth(int *newval, void **extra, GucSource source) if (stack_rlimit > 0 && newval_bytes > stack_rlimit - STACK_DEPTH_SLOP) { - GUC_check_errdetail("\"max_stack_depth\" must not exceed %ldkB.", + GUC_check_errdetail("max_stack_depth must not exceed %ldkB.", (stack_rlimit - STACK_DEPTH_SLOP) / 1024L); GUC_check_errhint("Increase the platform's stack depth limit via \"ulimit -s\" or local equivalent."); return false; @@ -3632,9 +3632,9 @@ check_log_stats(bool *newval, void **extra, GucSource source) if (*newval && (log_parser_stats || log_planner_stats || log_executor_stats)) { - GUC_check_errdetail("Cannot enable \"log_statement_stats\" when " - "\"log_parser_stats\", \"log_planner_stats\", " - "or \"log_executor_stats\" is true."); + GUC_check_errdetail("Cannot enable log_statement_stats when " + "log_parser_stats, log_planner_stats, " + "or log_executor_stats is true."); return false; } return true; diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c index fca9a2a..8ef5bf0 100644 --- a/src/backend/utils/adt/datetime.c +++ b/src/backend/utils/adt/datetime.c @@ -4022,7 +4022,7 @@ DateTimeParseError(int dterr, DateTimeErrorExtra *extra, (errcode(ERRCODE_DATETIME_FIELD_OVERFLOW), errmsg("date/time field value out of range: \"%s\"", str), - errhint("Perhaps you need a different \"datestyle\" setting."))); + errhint("Perhaps you need a different DateStyle setting."))); break; case DTERR_INTERVAL_OVERFLOW: errsave(escontext, diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c index d5003da..1dee462 100644 --- a/src/backend/utils/adt/pg_locale.c +++ b/src/backend/utils/adt/pg_locale.c @@ -2875,7 +2875,7 @@ icu_validate_locale(const char *loc_str) ereport(elevel, (errmsg("could not get language from ICU locale \"%s\": %s", loc_str, u_errorName(status)), - errhint("To disable ICU locale validation, set the parameter \"%s\" to \"%s\".", + errhint("To disable ICU locale validation, set the parameter %s to \"%s\".", "icu_validation_level", "disabled"))); return; } @@ -2904,7 +2904,7 @@ icu_validate_locale(const char *loc_str) ereport(elevel, (errmsg("ICU locale \"%s\" has unknown language \"%s\"", loc_str, lang), - errhint("To disable ICU locale validation, set the parameter \"%s\" to \"%s\".", + errhint("To disable ICU locale validation, set the parameter %s to \"%s\".", "icu_validation_level", "disabled"))); /* check that it can be opened */ diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c index b85d52c..56724ff 100644 --- a/src/backend/utils/fmgr/dfmgr.c +++ b/src/backend/utils/fmgr/dfmgr.c @@ -555,7 +555,7 @@ find_in_dynamic_libpath(const char *basename) if (piece == p) ereport(ERROR, (errcode(ERRCODE_INVALID_NAME), - errmsg("zero-length component in parameter \"dynamic_library_path\""))); + errmsg("zero-length component in parameter dynamic_library_path"))); if (piece == NULL) len = strlen(p); @@ -574,7 +574,7 @@ find_in_dynamic_libpath(const char *basename) if (!is_absolute_path(mangled)) ereport(ERROR, (errcode(ERRCODE_INVALID_NAME), - errmsg("component in parameter \"dynamic_library_path\" is not an absolute path"))); + errmsg("component in parameter dynamic_library_path is not an absolute path"))); full = palloc(strlen(mangled) + 1 + baselen + 1); sprintf(full, "%s/%s", mangled, basename); diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 82d8efb..e76c083 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -1873,7 +1873,7 @@ SelectConfigFiles(const char *userDoption, const char *progname) else { write_stderr("%s does not know where to find the database system data.\n" - "This can be specified as \"data_directory\" in \"%s\", " + "This can be specified as data_directory in \"%s\", " "or by the -D invocation option, or by the " "PGDATA environment variable.\n", progname, ConfigFileName); diff --git a/src/backend/utils/misc/guc_tables.c b/src/backend/utils/misc/guc_tables.c index b764ef6..67fedb2 100644 --- a/src/backend/utils/misc/guc_tables.c +++ b/src/backend/utils/misc/guc_tables.c @@ -3811,7 +3811,7 @@ struct config_string ConfigureNamesString[] = { {"archive_command", PGC_SIGHUP, WAL_ARCHIVING, gettext_noop("Sets the shell command that will be called to archive a WAL file."), - gettext_noop("This is used only if \"archive_library\" is not set.") + gettext_noop("This is used only if archive_library is not set.") }, &XLogArchiveCommand, "", @@ -3821,7 +3821,7 @@ struct config_string ConfigureNamesString[] = { {"archive_library", PGC_SIGHUP, WAL_ARCHIVING, gettext_noop("Sets the library that will be called to archive a WAL file."), - gettext_noop("An empty string indicates that \"archive_command\" should be used.") + gettext_noop("An empty string indicates that archive_command should be used.") }, &XLogArchiveLibrary, "", diff --git a/src/test/regress/expected/collate.icu.utf8.out b/src/test/regress/expected/collate.icu.utf8.out index 97bbe53..7a05c75 100644 --- a/src/test/regress/expected/collate.icu.utf8.out +++ b/src/test/regress/expected/collate.icu.utf8.out @@ -1042,7 +1042,7 @@ ERROR: parameter "locale" must be specified SET icu_validation_level = ERROR; CREATE COLLATION testx (provider = icu, locale = 'nonsense-nowhere'); -- fails ERROR: ICU locale "nonsense-nowhere" has unknown language "nonsense" -HINT: To disable ICU locale validation, set the parameter "icu_validation_level" to "disabled". +HINT: To disable ICU locale validation, set the parameter icu_validation_level to "disabled". CREATE COLLATION testx (provider = icu, locale = '@colStrength=primary;nonsense=yes'); -- fails ERROR: could not convert locale name "@colStrength=primary;nonsense=yes" to language tag: U_ILLEGAL_ARGUMENT_ERROR RESET icu_validation_level; @@ -1050,7 +1050,7 @@ CREATE COLLATION testx (provider = icu, locale = '@colStrength=primary;nonsense= WARNING: could not convert locale name "@colStrength=primary;nonsense=yes" to language tag: U_ILLEGAL_ARGUMENT_ERROR CREATE COLLATION testx (provider = icu, locale = 'nonsense-nowhere'); DROP COLLATION testx; WARNING: ICU locale "nonsense-nowhere" has unknown language "nonsense" -HINT: To disable ICU locale validation, set the parameter "icu_validation_level" to "disabled". +HINT: To disable ICU locale validation, set the parameter icu_validation_level to "disabled". CREATE COLLATION test4 FROM nonsense; ERROR: collation "nonsense" for encoding "UTF8" does not exist CREATE COLLATION test5 FROM test0; diff --git a/src/test/regress/expected/date.out b/src/test/regress/expected/date.out index f5949f3..99650bf 100644 --- a/src/test/regress/expected/date.out +++ b/src/test/regress/expected/date.out @@ -94,17 +94,17 @@ SELECT date '1/8/1999'; ERROR: date/time field value out of range: "1/8/1999" LINE 1: SELECT date '1/8/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1/18/1999'; ERROR: date/time field value out of range: "1/18/1999" LINE 1: SELECT date '1/18/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '18/1/1999'; ERROR: date/time field value out of range: "18/1/1999" LINE 1: SELECT date '18/1/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01/02/03'; date ------------ @@ -139,7 +139,7 @@ SELECT date 'January 8, 99 BC'; ERROR: date/time field value out of range: "January 8, 99 BC" LINE 1: SELECT date 'January 8, 99 BC'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '99-Jan-08'; date ------------ @@ -156,7 +156,7 @@ SELECT date '08-Jan-99'; ERROR: date/time field value out of range: "08-Jan-99" LINE 1: SELECT date '08-Jan-99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '08-Jan-1999'; date ------------ @@ -167,7 +167,7 @@ SELECT date 'Jan-08-99'; ERROR: date/time field value out of range: "Jan-08-99" LINE 1: SELECT date 'Jan-08-99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date 'Jan-08-1999'; date ------------ @@ -198,7 +198,7 @@ SELECT date '08 Jan 99'; ERROR: date/time field value out of range: "08 Jan 99" LINE 1: SELECT date '08 Jan 99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '08 Jan 1999'; date ------------ @@ -209,7 +209,7 @@ SELECT date 'Jan 08 99'; ERROR: date/time field value out of range: "Jan 08 99" LINE 1: SELECT date 'Jan 08 99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date 'Jan 08 1999'; date ------------ @@ -244,22 +244,22 @@ SELECT date '08-01-99'; ERROR: date/time field value out of range: "08-01-99" LINE 1: SELECT date '08-01-99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '08-01-1999'; ERROR: date/time field value out of range: "08-01-1999" LINE 1: SELECT date '08-01-1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01-08-99'; ERROR: date/time field value out of range: "01-08-99" LINE 1: SELECT date '01-08-99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01-08-1999'; ERROR: date/time field value out of range: "01-08-1999" LINE 1: SELECT date '01-08-1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '99-08-01'; date ------------ @@ -288,22 +288,22 @@ SELECT date '08 01 99'; ERROR: date/time field value out of range: "08 01 99" LINE 1: SELECT date '08 01 99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '08 01 1999'; ERROR: date/time field value out of range: "08 01 1999" LINE 1: SELECT date '08 01 1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01 08 99'; ERROR: date/time field value out of range: "01 08 99" LINE 1: SELECT date '01 08 99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01 08 1999'; ERROR: date/time field value out of range: "01 08 1999" LINE 1: SELECT date '01 08 1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '99 08 01'; date ------------ @@ -345,7 +345,7 @@ SELECT date '1/18/1999'; ERROR: date/time field value out of range: "1/18/1999" LINE 1: SELECT date '1/18/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '18/1/1999'; date ------------ @@ -392,7 +392,7 @@ SELECT date '99-Jan-08'; ERROR: date/time field value out of range: "99-Jan-08" LINE 1: SELECT date '99-Jan-08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-Jan-08'; date ------------ @@ -435,7 +435,7 @@ SELECT date '99 Jan 08'; ERROR: date/time field value out of range: "99 Jan 08" LINE 1: SELECT date '99 Jan 08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 Jan 08'; date ------------ @@ -480,7 +480,7 @@ SELECT date '99-01-08'; ERROR: date/time field value out of range: "99-01-08" LINE 1: SELECT date '99-01-08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-01-08'; date ------------ @@ -515,7 +515,7 @@ SELECT date '99-08-01'; ERROR: date/time field value out of range: "99-08-01" LINE 1: SELECT date '99-08-01'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-08-01'; date ------------ @@ -526,7 +526,7 @@ SELECT date '99 01 08'; ERROR: date/time field value out of range: "99 01 08" LINE 1: SELECT date '99 01 08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 01 08'; date ------------ @@ -561,7 +561,7 @@ SELECT date '99 08 01'; ERROR: date/time field value out of range: "99 08 01" LINE 1: SELECT date '99 08 01'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 08 01'; date ------------ @@ -603,7 +603,7 @@ SELECT date '18/1/1999'; ERROR: date/time field value out of range: "18/1/1999" LINE 1: SELECT date '18/1/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01/02/03'; date ------------ @@ -644,7 +644,7 @@ SELECT date '99-Jan-08'; ERROR: date/time field value out of range: "99-Jan-08" LINE 1: SELECT date '99-Jan-08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-Jan-08'; date ------------ @@ -731,7 +731,7 @@ SELECT date '99-01-08'; ERROR: date/time field value out of range: "99-01-08" LINE 1: SELECT date '99-01-08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-01-08'; date ------------ @@ -766,7 +766,7 @@ SELECT date '99-08-01'; ERROR: date/time field value out of range: "99-08-01" LINE 1: SELECT date '99-08-01'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-08-01'; date ------------ @@ -777,7 +777,7 @@ SELECT date '99 01 08'; ERROR: date/time field value out of range: "99 01 08" LINE 1: SELECT date '99 01 08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 01 08'; date ------------ @@ -812,7 +812,7 @@ SELECT date '99 08 01'; ERROR: date/time field value out of range: "99 08 01" LINE 1: SELECT date '99 08 01'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 08 01'; date ------------ diff --git a/src/test/regress/expected/horology.out b/src/test/regress/expected/horology.out index cfb4b20..4aeefd5 100644 --- a/src/test/regress/expected/horology.out +++ b/src/test/regress/expected/horology.out @@ -100,7 +100,7 @@ SELECT timestamp with time zone '27/12/2001 04:05:06.789-08'; ERROR: date/time field value out of range: "27/12/2001 04:05:06.789-08" LINE 1: SELECT timestamp with time zone '27/12/2001 04:05:06.789-08'... ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. set datestyle to dmy; SELECT timestamp with time zone '27/12/2001 04:05:06.789-08'; timestamptz diff --git a/src/test/regress/expected/json.out b/src/test/regress/expected/json.out index aa29bc5..7cb28f1 100644 --- a/src/test/regress/expected/json.out +++ b/src/test/regress/expected/json.out @@ -219,10 +219,10 @@ CONTEXT: JSON data, line 1: {"abc":1,3... SET max_stack_depth = '100kB'; SELECT repeat('[', 10000)::json; ERROR: stack depth limit exceeded -HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate. +HINT: Increase the configuration parameter max_stack_depth (currently 100kB), after ensuring the platform's stack depth limit is adequate. SELECT repeat('{"a":', 10000)::json; ERROR: stack depth limit exceeded -HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate. +HINT: Increase the configuration parameter max_stack_depth (currently 100kB), after ensuring the platform's stack depth limit is adequate. RESET max_stack_depth; -- Miscellaneous stuff. SELECT 'true'::json; -- OK diff --git a/src/test/regress/expected/jsonb.out b/src/test/regress/expected/jsonb.out index f8a7dac..b597d01 100644 --- a/src/test/regress/expected/jsonb.out +++ b/src/test/regress/expected/jsonb.out @@ -213,10 +213,10 @@ CONTEXT: JSON data, line 1: {"abc":1,3... SET max_stack_depth = '100kB'; SELECT repeat('[', 10000)::jsonb; ERROR: stack depth limit exceeded -HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate. +HINT: Increase the configuration parameter max_stack_depth (currently 100kB), after ensuring the platform's stack depth limit is adequate. SELECT repeat('{"a":', 10000)::jsonb; ERROR: stack depth limit exceeded -HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate. +HINT: Increase the configuration parameter max_stack_depth (currently 100kB), after ensuring the platform's stack depth limit is adequate. RESET max_stack_depth; -- Miscellaneous stuff. SELECT 'true'::jsonb; -- OK -- 1.8.3.1 ^ permalink raw reply [nested|flat] 21+ messages in thread
* Re: GUC names in messages @ 2023-11-30 05:59 Michael Paquier <[email protected]> parent: Peter Smith <[email protected]> 0 siblings, 4 replies; 21+ messages in thread From: Michael Paquier @ 2023-11-30 05:59 UTC (permalink / raw) To: Peter Smith <[email protected]>; +Cc: Alvaro Herrera <[email protected]>; Nathan Bossart <[email protected]>; Laurenz Albe <[email protected]>; Peter Eisentraut <[email protected]>; Tom Lane <[email protected]>; Daniel Gustafsson <[email protected]>; PostgreSQL Hackers <[email protected]> On Tue, Nov 28, 2023 at 11:54:33AM +1100, Peter Smith wrote: > Here is patch set v3. > > Patches 0001 and 0002 are unchanged from v2. After some grepping, I've noticed that 0002 had a mistake with track_commit_timestamp: some alternate output of modules/commit_ts/ was not updated. meson was able to reproduce the failure as well. I am not sure regarding what we should do a mixed cases as well, so I have discarded DateStyle for now, and applied the rest. Also applied 0001 from Alvaro. > Patch 0003 now uses a "%s%s%s" format specifier with GUC_FORMAT macro > in guc.c, as recently suggested by Michael [1]. I cannot think about a better idea as these strings need to be translated so they need three %s. + if (*p == '_') + underscore = true; + else if ('a' <= *p && *p <= 'z') + lowercase = true; An issue with this code is that it would forget to quote GUCs that use dots, like the ones from an extension. I don't really see why we cannot just make the macro return true only if all the characters of a GUC name is made of lower-case alpha characters? With an extra indentation applied, I finish with the attached for 0003. -- Michael Attachments: [text/x-diff] v4-0003-GUC-names-maybe-add-quotes.patch (50.8K, ../../[email protected]/2-v4-0003-GUC-names-maybe-add-quotes.patch) download | inline diff: From 77bd6b6f58ab1b0671f6afa12dc4e00900b456a8 Mon Sep 17 00:00:00 2001 From: Michael Paquier <[email protected]> Date: Thu, 30 Nov 2023 14:58:32 +0900 Subject: [PATCH v4] GUC names - maybe add quotes --- src/backend/utils/misc/guc.c | 278 ++++++++++++------ .../expected/test_oat_hooks.out | 16 +- .../unsafe_tests/expected/guc_privs.out | 58 ++-- .../unsafe_tests/expected/rolenames.out | 2 +- src/test/regress/expected/compression.out | 4 +- src/test/regress/expected/compression_1.out | 6 +- src/test/regress/expected/create_am.out | 4 +- src/test/regress/expected/guc.out | 30 +- src/test/regress/expected/password.out | 4 +- src/test/regress/expected/subscription.out | 2 +- src/test/regress/expected/transactions.out | 8 +- contrib/auto_explain/t/001_auto_explain.pl | 2 +- src/pl/plperl/expected/plperl_init.out | 4 +- 13 files changed, 259 insertions(+), 159 deletions(-) diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index e76c083003..aad72db9e5 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -265,6 +265,30 @@ static bool call_string_check_hook(struct config_string *conf, char **newval, static bool call_enum_check_hook(struct config_enum *conf, int *newval, void **extra, GucSource source, int elevel); +/* Macro for handling optional quotes around GUC names */ +#define GUC_FORMAT(s)\ + quotes_needed_for_GUC_name(s) ? "\"" : "",\ + s,\ + quotes_needed_for_GUC_name(s) ? "\"" : "" + +/* + * Return whether the GUC name should be enclosed in double-quotes. + * + * Quoting is intended for names which could be mistaken for normal English + * words. Quotes are only applied to GUC names that are written entirely with + * lower-case alphabetical characters. + */ +static bool +quotes_needed_for_GUC_name(const char *name) +{ + for (const char *p = name; *p; p++) + { + if ('a' > *p || *p > 'z') + return false; + } + + return true; +} /* * This function handles both actual config file (re)loads and execution of @@ -420,8 +444,9 @@ ProcessConfigFileInternal(GucContext context, bool applySettings, int elevel) /* Invalid non-custom variable, so complain */ ereport(elevel, (errcode(ERRCODE_UNDEFINED_OBJECT), - errmsg("unrecognized configuration parameter \"%s\" in file \"%s\" line %d", - item->name, + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("unrecognized configuration parameter %s%s%s in file \"%s\" line %d", + GUC_FORMAT(item->name), item->filename, item->sourceline))); item->errmsg = pstrdup("unrecognized configuration parameter"); error = true; @@ -460,10 +485,13 @@ ProcessConfigFileInternal(GucContext context, bool applySettings, int elevel) gconf->status |= GUC_PENDING_RESTART; ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed without restarting the server", - gconf->name))); - record_config_file_error(psprintf("parameter \"%s\" cannot be changed without restarting the server", - gconf->name), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s cannot be changed without restarting the server", + GUC_FORMAT(gconf->name)))); + record_config_file_error( + /* translator: %s%s%s is for an optionally quoted GUC name */ + psprintf("parameter %s%s%s cannot be changed without restarting the server", + GUC_FORMAT(gconf->name)), NULL, 0, &head, &tail); error = true; @@ -496,8 +524,9 @@ ProcessConfigFileInternal(GucContext context, bool applySettings, int elevel) /* Log the change if appropriate */ if (context == PGC_SIGHUP) ereport(elevel, - (errmsg("parameter \"%s\" removed from configuration file, reset to default", - gconf->name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + (errmsg("parameter %s%s%s removed from configuration file, reset to default", + GUC_FORMAT(gconf->name)))); } } @@ -561,8 +590,10 @@ ProcessConfigFileInternal(GucContext context, bool applySettings, int elevel) post_value = ""; if (strcmp(pre_value, post_value) != 0) ereport(elevel, - (errmsg("parameter \"%s\" changed to \"%s\"", - item->name, item->value))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + (errmsg("parameter %s%s%s changed to \"%s\"", + GUC_FORMAT(item->name), + item->value))); } item->applied = true; } @@ -1129,8 +1160,9 @@ assignable_custom_variable_name(const char *name, bool skip_errors, int elevel) if (!skip_errors) ereport(elevel, (errcode(ERRCODE_INVALID_NAME), - errmsg("invalid configuration parameter name \"%s\"", - name), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid configuration parameter name %s%s%s", + GUC_FORMAT(name)), errdetail("Custom parameter names must be two or more simple identifiers separated by dots."))); return false; } @@ -1145,8 +1177,9 @@ assignable_custom_variable_name(const char *name, bool skip_errors, int elevel) if (!skip_errors) ereport(elevel, (errcode(ERRCODE_INVALID_NAME), - errmsg("invalid configuration parameter name \"%s\"", - name), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid configuration parameter name %s%s%s", + GUC_FORMAT(name)), errdetail("\"%s\" is a reserved prefix.", rcprefix))); return false; @@ -1160,8 +1193,9 @@ assignable_custom_variable_name(const char *name, bool skip_errors, int elevel) if (!skip_errors) ereport(elevel, (errcode(ERRCODE_UNDEFINED_OBJECT), - errmsg("unrecognized configuration parameter \"%s\"", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("unrecognized configuration parameter %s%s%s", + GUC_FORMAT(name)))); return false; } @@ -1270,8 +1304,9 @@ find_option(const char *name, bool create_placeholders, bool skip_errors, if (!skip_errors) ereport(elevel, (errcode(ERRCODE_UNDEFINED_OBJECT), - errmsg("unrecognized configuration parameter \"%s\"", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("unrecognized configuration parameter %s%s%s", + GUC_FORMAT(name)))); return NULL; } @@ -3125,8 +3160,9 @@ parse_and_validate_value(struct config_generic *record, { ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("parameter \"%s\" requires a Boolean value", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s requires a Boolean value", + GUC_FORMAT(name)))); return false; } @@ -3145,8 +3181,9 @@ parse_and_validate_value(struct config_generic *record, { ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("invalid value for parameter \"%s\": \"%s\"", - name, value), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid value for parameter %s%s%s: \"%s\"", + GUC_FORMAT(name), value), hintmsg ? errhint("%s", _(hintmsg)) : 0)); return false; } @@ -3157,11 +3194,12 @@ parse_and_validate_value(struct config_generic *record, ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("%d%s%s is outside the valid range for parameter \"%s\" (%d .. %d)", + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("%d%s%s is outside the valid range for parameter %s%s%s (%d .. %d)", newval->intval, unit ? " " : "", unit ? unit : "", - name, + GUC_FORMAT(name), conf->min, conf->max))); return false; } @@ -3181,8 +3219,9 @@ parse_and_validate_value(struct config_generic *record, { ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("invalid value for parameter \"%s\": \"%s\"", - name, value), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid value for parameter %s%s%s: \"%s\"", + GUC_FORMAT(name), value), hintmsg ? errhint("%s", _(hintmsg)) : 0)); return false; } @@ -3193,11 +3232,12 @@ parse_and_validate_value(struct config_generic *record, ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("%g%s%s is outside the valid range for parameter \"%s\" (%g .. %g)", + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("%g%s%s is outside the valid range for parameter %s%s%s (%g .. %g)", newval->realval, unit ? " " : "", unit ? unit : "", - name, + GUC_FORMAT(name), conf->min, conf->max))); return false; } @@ -3251,8 +3291,9 @@ parse_and_validate_value(struct config_generic *record, ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("invalid value for parameter \"%s\": \"%s\"", - name, value), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid value for parameter %s%s%s: \"%s\"", + GUC_FORMAT(name), value), hintmsg ? errhint("%s", _(hintmsg)) : 0)); if (hintmsg) @@ -3410,8 +3451,9 @@ set_config_option_ext(const char *name, const char *value, { ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s cannot be changed", + GUC_FORMAT(name)))); return 0; } break; @@ -3433,8 +3475,9 @@ set_config_option_ext(const char *name, const char *value, { ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed without restarting the server", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s cannot be changed without restarting the server", + GUC_FORMAT(name)))); return 0; } break; @@ -3443,8 +3486,9 @@ set_config_option_ext(const char *name, const char *value, { ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed now", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s cannot be changed now", + GUC_FORMAT(name)))); return 0; } @@ -3470,8 +3514,9 @@ set_config_option_ext(const char *name, const char *value, /* No granted privilege */ ereport(elevel, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("permission denied to set parameter \"%s\"", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("permission denied to set parameter %s%s%s", + GUC_FORMAT(name)))); return 0; } } @@ -3508,8 +3553,9 @@ set_config_option_ext(const char *name, const char *value, { ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be set after connection start", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s cannot be set after connection start", + GUC_FORMAT(name)))); return 0; } break; @@ -3528,8 +3574,9 @@ set_config_option_ext(const char *name, const char *value, /* No granted privilege */ ereport(elevel, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("permission denied to set parameter \"%s\"", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("permission denied to set parameter %s%s%s", + GUC_FORMAT(name)))); return 0; } } @@ -3567,16 +3614,18 @@ set_config_option_ext(const char *name, const char *value, */ ereport(elevel, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("cannot set parameter \"%s\" within security-definer function", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("cannot set parameter %s%s%s within security-definer function", + GUC_FORMAT(name)))); return 0; } if (InSecurityRestrictedOperation()) { ereport(elevel, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("cannot set parameter \"%s\" within security-restricted operation", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("cannot set parameter %s%s%s within security-restricted operation", + GUC_FORMAT(name)))); return 0; } } @@ -3588,15 +3637,18 @@ set_config_option_ext(const char *name, const char *value, { ereport(elevel, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("parameter \"%s\" cannot be reset", name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s cannot be reset", + GUC_FORMAT(name)))); return 0; } if (action == GUC_ACTION_SAVE) { ereport(elevel, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("parameter \"%s\" cannot be set locally in functions", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s cannot be set locally in functions", + GUC_FORMAT(name)))); return 0; } } @@ -3621,8 +3673,8 @@ set_config_option_ext(const char *name, const char *value, { if (changeVal && !makeDefault) { - elog(DEBUG3, "\"%s\": setting ignored because previous source is higher priority", - name); + elog(DEBUG3, "%s%s%s: setting ignored because previous source is higher priority", + GUC_FORMAT(name)); return -1; } changeVal = false; @@ -3673,8 +3725,13 @@ set_config_option_ext(const char *name, const char *value, record->status |= GUC_PENDING_RESTART; ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed without restarting the server", - name))); + + /* + * translator: %s%s%s is for an optionally quoted GUC + * name + */ + errmsg("parameter %s%s%s cannot be changed without restarting the server", + GUC_FORMAT(name)))); return 0; } record->status &= ~GUC_PENDING_RESTART; @@ -3771,8 +3828,13 @@ set_config_option_ext(const char *name, const char *value, record->status |= GUC_PENDING_RESTART; ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed without restarting the server", - name))); + + /* + * translator: %s%s%s is for an optionally quoted GUC + * name + */ + errmsg("parameter %s%s%s cannot be changed without restarting the server", + GUC_FORMAT(name)))); return 0; } record->status &= ~GUC_PENDING_RESTART; @@ -3869,8 +3931,13 @@ set_config_option_ext(const char *name, const char *value, record->status |= GUC_PENDING_RESTART; ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed without restarting the server", - name))); + + /* + * translator: %s%s%s is for an optionally quoted GUC + * name + */ + errmsg("parameter %s%s%s cannot be changed without restarting the server", + GUC_FORMAT(name)))); return 0; } record->status &= ~GUC_PENDING_RESTART; @@ -3993,8 +4060,13 @@ set_config_option_ext(const char *name, const char *value, record->status |= GUC_PENDING_RESTART; ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed without restarting the server", - name))); + + /* + * translator: %s%s%s is for an optionally quoted GUC + * name + */ + errmsg("parameter %s%s%s cannot be changed without restarting the server", + GUC_FORMAT(name)))); return 0; } record->status &= ~GUC_PENDING_RESTART; @@ -4096,8 +4168,13 @@ set_config_option_ext(const char *name, const char *value, record->status |= GUC_PENDING_RESTART; ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed without restarting the server", - name))); + + /* + * translator: %s%s%s is for an optionally quoted GUC + * name + */ + errmsg("parameter %s%s%s cannot be changed without restarting the server", + GUC_FORMAT(name)))); return 0; } record->status &= ~GUC_PENDING_RESTART; @@ -4238,7 +4315,9 @@ GetConfigOption(const char *name, bool missing_ok, bool restrict_privileged) !ConfigOptionIsVisible(record)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("permission denied to examine \"%s\"", name), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("permission denied to examine %s%s%s", + GUC_FORMAT(name)), errdetail("Only roles with privileges of the \"%s\" role may examine this parameter.", "pg_read_all_settings"))); @@ -4534,8 +4613,9 @@ AlterSystemSetConfigFile(AlterSystemStmt *altersysstmt) if (aclresult != ACLCHECK_OK) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("permission denied to set parameter \"%s\"", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("permission denied to set parameter %s%s%s", + GUC_FORMAT(name)))); } } @@ -4559,8 +4639,9 @@ AlterSystemSetConfigFile(AlterSystemStmt *altersysstmt) (record->flags & GUC_DISALLOW_IN_AUTO_FILE)) ereport(ERROR, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("parameter \"%s\" cannot be changed", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s cannot be changed", + GUC_FORMAT(name)))); /* * If a value is specified, verify that it's sane. @@ -4575,8 +4656,9 @@ AlterSystemSetConfigFile(AlterSystemStmt *altersysstmt) &newval, &newextra)) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("invalid value for parameter \"%s\": \"%s\"", - name, value))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid value for parameter %s%s%s: \"%s\"", + GUC_FORMAT(name), value))); if (record->vartype == PGC_STRING && newval.stringval != NULL) guc_free(newval.stringval); @@ -4830,7 +4912,9 @@ define_custom_variable(struct config_generic *variable) if ((hentry->gucvar->flags & GUC_CUSTOM_PLACEHOLDER) == 0) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), - errmsg("attempt to redefine parameter \"%s\"", name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("attempt to redefine parameter %s%s%s", + GUC_FORMAT(name)))); Assert(hentry->gucvar->vartype == PGC_STRING); pHolder = (struct config_string *) hentry->gucvar; @@ -5169,8 +5253,9 @@ MarkGUCPrefixReserved(const char *className) { ereport(WARNING, (errcode(ERRCODE_INVALID_NAME), - errmsg("invalid configuration parameter name \"%s\", removing it", - var->name), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid configuration parameter name %s%s%s, removing it", + GUC_FORMAT(var->name)), errdetail("\"%s\" is now a reserved prefix.", className))); /* Remove it from the hash table */ @@ -5313,7 +5398,9 @@ GetConfigOptionByName(const char *name, const char **varname, bool missing_ok) if (!ConfigOptionIsVisible(record)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("permission denied to examine \"%s\"", name), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("permission denied to examine %s%s%s", + GUC_FORMAT(name)), errdetail("Only roles with privileges of the \"%s\" role may examine this parameter.", "pg_read_all_settings"))); @@ -5639,7 +5726,8 @@ read_nondefault_variables(void) break; if (find_option(varname, true, false, FATAL) == NULL) - elog(FATAL, "failed to locate variable \"%s\" in exec config params file", varname); + elog(FATAL, "failed to locate variable %s%s%s in exec config params file", + GUC_FORMAT(varname)); if ((varvalue = read_string_with_null(fp)) == NULL) elog(FATAL, "invalid format of exec config params file"); @@ -6048,8 +6136,9 @@ guc_restore_error_context_callback(void *arg) char **error_context_name_and_value = (char **) arg; if (error_context_name_and_value) - errcontext("while setting parameter \"%s\" to \"%s\"", - error_context_name_and_value[0], + /* translator: %s%s%s is for an optionally quoted GUC name */ + errcontext("while setting parameter %s%s%s to \"%s\"", + GUC_FORMAT(error_context_name_and_value[0]), error_context_name_and_value[1]); } @@ -6217,7 +6306,9 @@ RestoreGUCState(void *gucstate) if (result <= 0) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), - errmsg("parameter \"%s\" could not be set", varname))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("parameter %s%s%s could not be set", + GUC_FORMAT(varname)))); if (varsourcefile[0]) set_config_sourcefile(varname, varsourcefile, varsourceline); error_context_callback.arg = NULL; @@ -6307,8 +6398,9 @@ TransformGUCArray(ArrayType *array, List **names, List **values) { ereport(WARNING, (errcode(ERRCODE_SYNTAX_ERROR), - errmsg("could not parse setting for parameter \"%s\"", - name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("could not parse setting for parameter %s%s%s", + GUC_FORMAT(name)))); pfree(name); continue; } @@ -6625,7 +6717,9 @@ validate_option_array_item(const char *name, const char *value, return false; ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("permission denied to set parameter \"%s\"", name))); + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("permission denied to set parameter %s%s%s", + GUC_FORMAT(name)))); } /* manual permissions check so we can avoid an error being thrown */ @@ -6689,8 +6783,9 @@ call_bool_check_hook(struct config_bool *conf, bool *newval, void **extra, (errcode(GUC_check_errcode_value), GUC_check_errmsg_string ? errmsg_internal("%s", GUC_check_errmsg_string) : - errmsg("invalid value for parameter \"%s\": %d", - conf->gen.name, (int) *newval), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid value for parameter %s%s%s: %d", + GUC_FORMAT(conf->gen.name), (int) *newval), GUC_check_errdetail_string ? errdetail_internal("%s", GUC_check_errdetail_string) : 0, GUC_check_errhint_string ? @@ -6723,8 +6818,9 @@ call_int_check_hook(struct config_int *conf, int *newval, void **extra, (errcode(GUC_check_errcode_value), GUC_check_errmsg_string ? errmsg_internal("%s", GUC_check_errmsg_string) : - errmsg("invalid value for parameter \"%s\": %d", - conf->gen.name, *newval), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid value for parameter %s%s%s: %d", + GUC_FORMAT(conf->gen.name), *newval), GUC_check_errdetail_string ? errdetail_internal("%s", GUC_check_errdetail_string) : 0, GUC_check_errhint_string ? @@ -6757,8 +6853,9 @@ call_real_check_hook(struct config_real *conf, double *newval, void **extra, (errcode(GUC_check_errcode_value), GUC_check_errmsg_string ? errmsg_internal("%s", GUC_check_errmsg_string) : - errmsg("invalid value for parameter \"%s\": %g", - conf->gen.name, *newval), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid value for parameter %s%s%s: %g", + GUC_FORMAT(conf->gen.name), *newval), GUC_check_errdetail_string ? errdetail_internal("%s", GUC_check_errdetail_string) : 0, GUC_check_errhint_string ? @@ -6800,8 +6897,10 @@ call_string_check_hook(struct config_string *conf, char **newval, void **extra, (errcode(GUC_check_errcode_value), GUC_check_errmsg_string ? errmsg_internal("%s", GUC_check_errmsg_string) : - errmsg("invalid value for parameter \"%s\": \"%s\"", - conf->gen.name, *newval ? *newval : ""), + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid value for parameter %s%s%s: \"%s\"", + GUC_FORMAT(conf->gen.name), + *newval ? *newval : ""), GUC_check_errdetail_string ? errdetail_internal("%s", GUC_check_errdetail_string) : 0, GUC_check_errhint_string ? @@ -6841,8 +6940,9 @@ call_enum_check_hook(struct config_enum *conf, int *newval, void **extra, (errcode(GUC_check_errcode_value), GUC_check_errmsg_string ? errmsg_internal("%s", GUC_check_errmsg_string) : - errmsg("invalid value for parameter \"%s\": \"%s\"", - conf->gen.name, + /* translator: %s%s%s is for an optionally quoted GUC name */ + errmsg("invalid value for parameter %s%s%s: \"%s\"", + GUC_FORMAT(conf->gen.name), config_enum_lookup_by_value(conf, *newval)), GUC_check_errdetail_string ? errdetail_internal("%s", GUC_check_errdetail_string) : 0, diff --git a/src/test/modules/test_oat_hooks/expected/test_oat_hooks.out b/src/test/modules/test_oat_hooks/expected/test_oat_hooks.out index f80373aecc..042569d27a 100644 --- a/src/test/modules/test_oat_hooks/expected/test_oat_hooks.out +++ b/src/test/modules/test_oat_hooks/expected/test_oat_hooks.out @@ -180,10 +180,10 @@ NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, NOTICE: in process utility: non-superuser finished RESET ALTER SYSTEM SET work_mem = 8192; NOTICE: in process utility: non-superuser attempting ALTER SYSTEM -ERROR: permission denied to set parameter "work_mem" +ERROR: permission denied to set parameter work_mem ALTER SYSTEM RESET work_mem; NOTICE: in process utility: non-superuser attempting ALTER SYSTEM -ERROR: permission denied to set parameter "work_mem" +ERROR: permission denied to set parameter work_mem SET test_oat_hooks.user_var1 = true; NOTICE: in process utility: non-superuser attempting SET NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [test_oat_hooks.user_var1] @@ -191,13 +191,13 @@ NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, NOTICE: in process utility: non-superuser finished SET SET test_oat_hooks.super_var1 = true; NOTICE: in process utility: non-superuser attempting SET -ERROR: permission denied to set parameter "test_oat_hooks.super_var1" +ERROR: permission denied to set parameter test_oat_hooks.super_var1 ALTER SYSTEM SET test_oat_hooks.user_var1 = true; NOTICE: in process utility: non-superuser attempting ALTER SYSTEM -ERROR: permission denied to set parameter "test_oat_hooks.user_var1" +ERROR: permission denied to set parameter test_oat_hooks.user_var1 ALTER SYSTEM SET test_oat_hooks.super_var1 = true; NOTICE: in process utility: non-superuser attempting ALTER SYSTEM -ERROR: permission denied to set parameter "test_oat_hooks.super_var1" +ERROR: permission denied to set parameter test_oat_hooks.super_var1 SET test_oat_hooks.user_var2 = true; NOTICE: in process utility: non-superuser attempting SET NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [test_oat_hooks.user_var2] @@ -205,13 +205,13 @@ NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, NOTICE: in process utility: non-superuser finished SET SET test_oat_hooks.super_var2 = true; NOTICE: in process utility: non-superuser attempting SET -ERROR: permission denied to set parameter "test_oat_hooks.super_var2" +ERROR: permission denied to set parameter test_oat_hooks.super_var2 ALTER SYSTEM SET test_oat_hooks.user_var2 = true; NOTICE: in process utility: non-superuser attempting ALTER SYSTEM -ERROR: permission denied to set parameter "test_oat_hooks.user_var2" +ERROR: permission denied to set parameter test_oat_hooks.user_var2 ALTER SYSTEM SET test_oat_hooks.super_var2 = true; NOTICE: in process utility: non-superuser attempting ALTER SYSTEM -ERROR: permission denied to set parameter "test_oat_hooks.super_var2" +ERROR: permission denied to set parameter test_oat_hooks.super_var2 RESET SESSION AUTHORIZATION; NOTICE: in process utility: non-superuser attempting RESET NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [session_authorization] diff --git a/src/test/modules/unsafe_tests/expected/guc_privs.out b/src/test/modules/unsafe_tests/expected/guc_privs.out index 6c0ad89834..6c594a4b40 100644 --- a/src/test/modules/unsafe_tests/expected/guc_privs.out +++ b/src/test/modules/unsafe_tests/expected/guc_privs.out @@ -8,31 +8,31 @@ CREATE ROLE regress_admin SUPERUSER; SET SESSION AUTHORIZATION regress_admin; -- PGC_BACKEND SET ignore_system_indexes = OFF; -- fail, cannot be set after connection start -ERROR: parameter "ignore_system_indexes" cannot be set after connection start +ERROR: parameter ignore_system_indexes cannot be set after connection start RESET ignore_system_indexes; -- fail, cannot be set after connection start -ERROR: parameter "ignore_system_indexes" cannot be set after connection start +ERROR: parameter ignore_system_indexes cannot be set after connection start ALTER SYSTEM SET ignore_system_indexes = OFF; -- ok ALTER SYSTEM RESET ignore_system_indexes; -- ok -- PGC_INTERNAL SET block_size = 50; -- fail, cannot be changed -ERROR: parameter "block_size" cannot be changed +ERROR: parameter block_size cannot be changed RESET block_size; -- fail, cannot be changed -ERROR: parameter "block_size" cannot be changed +ERROR: parameter block_size cannot be changed ALTER SYSTEM SET block_size = 50; -- fail, cannot be changed -ERROR: parameter "block_size" cannot be changed +ERROR: parameter block_size cannot be changed ALTER SYSTEM RESET block_size; -- fail, cannot be changed -ERROR: parameter "block_size" cannot be changed +ERROR: parameter block_size cannot be changed -- PGC_POSTMASTER SET autovacuum_freeze_max_age = 1000050000; -- fail, requires restart -ERROR: parameter "autovacuum_freeze_max_age" cannot be changed without restarting the server +ERROR: parameter autovacuum_freeze_max_age cannot be changed without restarting the server RESET autovacuum_freeze_max_age; -- fail, requires restart -ERROR: parameter "autovacuum_freeze_max_age" cannot be changed without restarting the server +ERROR: parameter autovacuum_freeze_max_age cannot be changed without restarting the server ALTER SYSTEM SET autovacuum_freeze_max_age = 1000050000; -- ok ALTER SYSTEM RESET autovacuum_freeze_max_age; -- ok ALTER SYSTEM SET config_file = '/usr/local/data/postgresql.conf'; -- fail, cannot be changed -ERROR: parameter "config_file" cannot be changed +ERROR: parameter config_file cannot be changed ALTER SYSTEM RESET config_file; -- fail, cannot be changed -ERROR: parameter "config_file" cannot be changed +ERROR: parameter config_file cannot be changed -- PGC_SIGHUP SET autovacuum = OFF; -- fail, requires reload ERROR: parameter "autovacuum" cannot be changed now @@ -47,9 +47,9 @@ ALTER SYSTEM SET lc_messages = 'C'; -- ok ALTER SYSTEM RESET lc_messages; -- ok -- PGC_SU_BACKEND SET jit_debugging_support = OFF; -- fail, cannot be set after connection start -ERROR: parameter "jit_debugging_support" cannot be set after connection start +ERROR: parameter jit_debugging_support cannot be set after connection start RESET jit_debugging_support; -- fail, cannot be set after connection start -ERROR: parameter "jit_debugging_support" cannot be set after connection start +ERROR: parameter jit_debugging_support cannot be set after connection start ALTER SYSTEM SET jit_debugging_support = OFF; -- ok ALTER SYSTEM RESET jit_debugging_support; -- ok -- PGC_USERSET @@ -58,9 +58,9 @@ RESET DateStyle; -- ok ALTER SYSTEM SET DateStyle = 'ISO, MDY'; -- ok ALTER SYSTEM RESET DateStyle; -- ok ALTER SYSTEM SET ssl_renegotiation_limit = 0; -- fail, cannot be changed -ERROR: parameter "ssl_renegotiation_limit" cannot be changed +ERROR: parameter ssl_renegotiation_limit cannot be changed ALTER SYSTEM RESET ssl_renegotiation_limit; -- fail, cannot be changed -ERROR: parameter "ssl_renegotiation_limit" cannot be changed +ERROR: parameter ssl_renegotiation_limit cannot be changed -- Finished testing superuser -- Create non-superuser with privileges to configure host resource usage CREATE ROLE regress_host_resource_admin NOSUPERUSER; @@ -224,7 +224,7 @@ SELECT 1 FROM pg_parameter_acl WHERE parname = 'none.such'; ALTER SYSTEM SET none.such = 'whiz bang'; -- None of the above should have created a placeholder GUC for none.such. SHOW none.such; -- error -ERROR: unrecognized configuration parameter "none.such" +ERROR: unrecognized configuration parameter none.such -- However, if we reload ... SELECT pg_reload_conf(); pg_reload_conf @@ -244,7 +244,7 @@ SHOW none.such; -- Can't grant on a non-existent core GUC. GRANT ALL ON PARAMETER no_such_guc TO regress_host_resource_admin; -- fail -ERROR: unrecognized configuration parameter "no_such_guc" +ERROR: unrecognized configuration parameter no_such_guc -- Initially there are no privileges and no catalog entry for this GUC. SELECT has_parameter_privilege('regress_host_resource_admin', 'enable_material', 'SET'); has_parameter_privilege @@ -446,17 +446,17 @@ ALTER ROLE regress_host_resource_admin SET lc_messages = 'C'; SET SESSION AUTHORIZATION regress_host_resource_admin; ALTER SYSTEM SET autovacuum_work_mem = 32; -- ok, privileges have been granted ALTER SYSTEM SET ignore_system_indexes = OFF; -- fail, insufficient privileges -ERROR: permission denied to set parameter "ignore_system_indexes" +ERROR: permission denied to set parameter ignore_system_indexes ALTER SYSTEM RESET autovacuum_multixact_freeze_max_age; -- fail, insufficient privileges -ERROR: permission denied to set parameter "autovacuum_multixact_freeze_max_age" +ERROR: permission denied to set parameter autovacuum_multixact_freeze_max_age SET jit_provider = 'llvmjit'; -- fail, insufficient privileges -ERROR: parameter "jit_provider" cannot be changed without restarting the server +ERROR: parameter jit_provider cannot be changed without restarting the server SELECT set_config ('jit_provider', 'llvmjit', true); -- fail, insufficient privileges -ERROR: parameter "jit_provider" cannot be changed without restarting the server +ERROR: parameter jit_provider cannot be changed without restarting the server ALTER SYSTEM SET shared_buffers = 50; -- ok ALTER SYSTEM RESET shared_buffers; -- ok SET autovacuum_work_mem = 50; -- cannot be changed now -ERROR: parameter "autovacuum_work_mem" cannot be changed now +ERROR: parameter autovacuum_work_mem cannot be changed now ALTER SYSTEM RESET temp_file_limit; -- ok SET TimeZone = 'Europe/Helsinki'; -- ok RESET TimeZone; -- ok @@ -465,13 +465,13 @@ RESET max_stack_depth; -- ok, privileges have been granted ALTER SYSTEM SET max_stack_depth = '100kB'; -- ok, privileges have been granted ALTER SYSTEM RESET max_stack_depth; -- ok, privileges have been granted SET lc_messages = 'C'; -- fail, insufficient privileges -ERROR: permission denied to set parameter "lc_messages" +ERROR: permission denied to set parameter lc_messages RESET lc_messages; -- fail, insufficient privileges -ERROR: permission denied to set parameter "lc_messages" +ERROR: permission denied to set parameter lc_messages ALTER SYSTEM SET lc_messages = 'C'; -- fail, insufficient privileges -ERROR: permission denied to set parameter "lc_messages" +ERROR: permission denied to set parameter lc_messages ALTER SYSTEM RESET lc_messages; -- fail, insufficient privileges -ERROR: permission denied to set parameter "lc_messages" +ERROR: permission denied to set parameter lc_messages SELECT set_config ('temp_buffers', '8192', false); -- ok set_config ------------ @@ -482,9 +482,9 @@ ALTER SYSTEM RESET autovacuum_work_mem; -- ok, privileges have been granted ALTER SYSTEM RESET ALL; -- fail, insufficient privileges ERROR: permission denied to perform ALTER SYSTEM RESET ALL ALTER SYSTEM SET none.such2 = 'whiz bang'; -- fail, not superuser -ERROR: permission denied to set parameter "none.such2" +ERROR: permission denied to set parameter none.such2 ALTER ROLE regress_host_resource_admin SET lc_messages = 'POSIX'; -- fail -ERROR: permission denied to set parameter "lc_messages" +ERROR: permission denied to set parameter lc_messages ALTER ROLE regress_host_resource_admin SET max_stack_depth = '1MB'; -- ok SELECT setconfig FROM pg_db_role_setting WHERE setrole = 'regress_host_resource_admin'::regrole; @@ -537,7 +537,7 @@ DROP ROLE regress_host_resource_admin; -- ok CREATE ROLE regress_host_resource_admin NOSUPERUSER; SET SESSION AUTHORIZATION regress_host_resource_admin; ALTER SYSTEM SET autovacuum_work_mem = 32; -- fail, privileges not yet granted -ERROR: permission denied to set parameter "autovacuum_work_mem" +ERROR: permission denied to set parameter autovacuum_work_mem SET SESSION AUTHORIZATION regress_admin; GRANT SET, ALTER SYSTEM ON PARAMETER autovacuum_work_mem, hash_mem_multiplier, max_stack_depth, @@ -554,7 +554,7 @@ privileges for parameter work_mem DROP OWNED BY regress_host_resource_admin RESTRICT; -- cascade should not be needed SET SESSION AUTHORIZATION regress_host_resource_admin; ALTER SYSTEM SET autovacuum_work_mem = 32; -- fail, "drop owned" has dropped privileges -ERROR: permission denied to set parameter "autovacuum_work_mem" +ERROR: permission denied to set parameter autovacuum_work_mem SET SESSION AUTHORIZATION regress_admin; DROP ROLE regress_host_resource_admin; -- ok -- Check that "reassign owned" doesn't affect privileges diff --git a/src/test/modules/unsafe_tests/expected/rolenames.out b/src/test/modules/unsafe_tests/expected/rolenames.out index 61396b2a80..21d2bac322 100644 --- a/src/test/modules/unsafe_tests/expected/rolenames.out +++ b/src/test/modules/unsafe_tests/expected/rolenames.out @@ -1077,7 +1077,7 @@ SHOW session_preload_libraries; SET SESSION AUTHORIZATION regress_role_nopriv; -- fails with role not member of pg_read_all_settings SHOW session_preload_libraries; -ERROR: permission denied to examine "session_preload_libraries" +ERROR: permission denied to examine session_preload_libraries DETAIL: Only roles with privileges of the "pg_read_all_settings" role may examine this parameter. RESET SESSION AUTHORIZATION; ERROR: current transaction is aborted, commands ignored until end of transaction block diff --git a/src/test/regress/expected/compression.out b/src/test/regress/expected/compression.out index 834b7555cb..7426504e20 100644 --- a/src/test/regress/expected/compression.out +++ b/src/test/regress/expected/compression.out @@ -234,10 +234,10 @@ ERROR: column "f1" has a compression method conflict DETAIL: pglz versus lz4 -- test default_toast_compression GUC SET default_toast_compression = ''; -ERROR: invalid value for parameter "default_toast_compression": "" +ERROR: invalid value for parameter default_toast_compression: "" HINT: Available values: pglz, lz4. SET default_toast_compression = 'I do not exist compression'; -ERROR: invalid value for parameter "default_toast_compression": "I do not exist compression" +ERROR: invalid value for parameter default_toast_compression: "I do not exist compression" HINT: Available values: pglz, lz4. SET default_toast_compression = 'lz4'; SET default_toast_compression = 'pglz'; diff --git a/src/test/regress/expected/compression_1.out b/src/test/regress/expected/compression_1.out index ddcd137c49..5234e47b44 100644 --- a/src/test/regress/expected/compression_1.out +++ b/src/test/regress/expected/compression_1.out @@ -225,13 +225,13 @@ ERROR: column "f1" has a compression method conflict DETAIL: pglz versus lz4 -- test default_toast_compression GUC SET default_toast_compression = ''; -ERROR: invalid value for parameter "default_toast_compression": "" +ERROR: invalid value for parameter default_toast_compression: "" HINT: Available values: pglz. SET default_toast_compression = 'I do not exist compression'; -ERROR: invalid value for parameter "default_toast_compression": "I do not exist compression" +ERROR: invalid value for parameter default_toast_compression: "I do not exist compression" HINT: Available values: pglz. SET default_toast_compression = 'lz4'; -ERROR: invalid value for parameter "default_toast_compression": "lz4" +ERROR: invalid value for parameter default_toast_compression: "lz4" HINT: Available values: pglz. SET default_toast_compression = 'pglz'; -- test alter compression method diff --git a/src/test/regress/expected/create_am.out b/src/test/regress/expected/create_am.out index b50293d514..afa11a6dc9 100644 --- a/src/test/regress/expected/create_am.out +++ b/src/test/regress/expected/create_am.out @@ -112,11 +112,11 @@ COMMIT; -- -- prevent empty values SET default_table_access_method = ''; -ERROR: invalid value for parameter "default_table_access_method": "" +ERROR: invalid value for parameter default_table_access_method: "" DETAIL: default_table_access_method cannot be empty. -- prevent nonexistent values SET default_table_access_method = 'I do not exist AM'; -ERROR: invalid value for parameter "default_table_access_method": "I do not exist AM" +ERROR: invalid value for parameter default_table_access_method: "I do not exist AM" DETAIL: Table access method "I do not exist AM" does not exist. -- prevent setting it to an index AM SET default_table_access_method = 'btree'; diff --git a/src/test/regress/expected/guc.out b/src/test/regress/expected/guc.out index 127c953297..95b2414bd1 100644 --- a/src/test/regress/expected/guc.out +++ b/src/test/regress/expected/guc.out @@ -508,15 +508,15 @@ SELECT '2006-08-13 12:34:56'::timestamptz; -- Test some simple error cases SET seq_page_cost TO 'NaN'; -ERROR: invalid value for parameter "seq_page_cost": "NaN" +ERROR: invalid value for parameter seq_page_cost: "NaN" SET vacuum_cost_delay TO '10s'; -ERROR: 10000 ms is outside the valid range for parameter "vacuum_cost_delay" (0 .. 100) +ERROR: 10000 ms is outside the valid range for parameter vacuum_cost_delay (0 .. 100) SET no_such_variable TO 42; -ERROR: unrecognized configuration parameter "no_such_variable" +ERROR: unrecognized configuration parameter no_such_variable -- Test "custom" GUCs created on the fly (which aren't really an -- intended feature, but many people use them). SHOW custom.my_guc; -- error, not known yet -ERROR: unrecognized configuration parameter "custom.my_guc" +ERROR: unrecognized configuration parameter custom.my_guc SET custom.my_guc = 42; SHOW custom.my_guc; custom.my_guc @@ -539,26 +539,26 @@ SHOW custom.my.qualified.guc; (1 row) SET custom."bad-guc" = 42; -- disallowed because -c cannot set this name -ERROR: invalid configuration parameter name "custom.bad-guc" +ERROR: invalid configuration parameter name custom.bad-guc DETAIL: Custom parameter names must be two or more simple identifiers separated by dots. SHOW custom."bad-guc"; -ERROR: unrecognized configuration parameter "custom.bad-guc" +ERROR: unrecognized configuration parameter custom.bad-guc SET special."weird name" = 'foo'; -- could be allowed, but we choose not to -ERROR: invalid configuration parameter name "special.weird name" +ERROR: invalid configuration parameter name special.weird name DETAIL: Custom parameter names must be two or more simple identifiers separated by dots. SHOW special."weird name"; -ERROR: unrecognized configuration parameter "special.weird name" +ERROR: unrecognized configuration parameter special.weird name -- Check what happens when you try to set a "custom" GUC within the -- namespace of an extension. SET plpgsql.extra_foo_warnings = true; -- allowed if plpgsql is not loaded yet LOAD 'plpgsql'; -- this will throw a warning and delete the variable -WARNING: invalid configuration parameter name "plpgsql.extra_foo_warnings", removing it +WARNING: invalid configuration parameter name plpgsql.extra_foo_warnings, removing it DETAIL: "plpgsql" is now a reserved prefix. SET plpgsql.extra_foo_warnings = true; -- now, it's an error -ERROR: invalid configuration parameter name "plpgsql.extra_foo_warnings" +ERROR: invalid configuration parameter name plpgsql.extra_foo_warnings DETAIL: "plpgsql" is a reserved prefix. SHOW plpgsql.extra_foo_warnings; -ERROR: unrecognized configuration parameter "plpgsql.extra_foo_warnings" +ERROR: unrecognized configuration parameter plpgsql.extra_foo_warnings -- -- Test DISCARD TEMP -- @@ -775,9 +775,9 @@ select myfunc(1), current_setting('work_mem'); -- check current_setting()'s behavior with invalid setting name select current_setting('nosuch.setting'); -- FAIL -ERROR: unrecognized configuration parameter "nosuch.setting" +ERROR: unrecognized configuration parameter nosuch.setting select current_setting('nosuch.setting', false); -- FAIL -ERROR: unrecognized configuration parameter "nosuch.setting" +ERROR: unrecognized configuration parameter nosuch.setting select current_setting('nosuch.setting', true) is null; ?column? ---------- @@ -811,14 +811,14 @@ create function func_with_bad_set() returns int as $$ select 1 $$ language sql set default_text_search_config = no_such_config; NOTICE: text search configuration "no_such_config" does not exist -ERROR: invalid value for parameter "default_text_search_config": "no_such_config" +ERROR: invalid value for parameter default_text_search_config: "no_such_config" set check_function_bodies = off; create function func_with_bad_set() returns int as $$ select 1 $$ language sql set default_text_search_config = no_such_config; NOTICE: text search configuration "no_such_config" does not exist select func_with_bad_set(); -ERROR: invalid value for parameter "default_text_search_config": "no_such_config" +ERROR: invalid value for parameter default_text_search_config: "no_such_config" reset check_function_bodies; set default_with_oids to f; -- Should not allow to set it to true. diff --git a/src/test/regress/expected/password.out b/src/test/regress/expected/password.out index 924d6e001d..752cffcda0 100644 --- a/src/test/regress/expected/password.out +++ b/src/test/regress/expected/password.out @@ -3,10 +3,10 @@ -- -- Tests for GUC password_encryption SET password_encryption = 'novalue'; -- error -ERROR: invalid value for parameter "password_encryption": "novalue" +ERROR: invalid value for parameter password_encryption: "novalue" HINT: Available values: md5, scram-sha-256. SET password_encryption = true; -- error -ERROR: invalid value for parameter "password_encryption": "true" +ERROR: invalid value for parameter password_encryption: "true" HINT: Available values: md5, scram-sha-256. SET password_encryption = 'md5'; -- ok SET password_encryption = 'scram-sha-256'; -- ok diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index b15eddbff3..8d9229a932 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -220,7 +220,7 @@ RESET ROLE; ALTER SUBSCRIPTION regress_testsub RENAME TO regress_testsub_foo; ALTER SUBSCRIPTION regress_testsub_foo SET (synchronous_commit = local); ALTER SUBSCRIPTION regress_testsub_foo SET (synchronous_commit = foobar); -ERROR: invalid value for parameter "synchronous_commit": "foobar" +ERROR: invalid value for parameter synchronous_commit: "foobar" HINT: Available values: local, remote_write, remote_apply, on, off. \dRs+ List of subscriptions diff --git a/src/test/regress/expected/transactions.out b/src/test/regress/expected/transactions.out index 7f5757e89c..5939ad4d2e 100644 --- a/src/test/regress/expected/transactions.out +++ b/src/test/regress/expected/transactions.out @@ -53,7 +53,7 @@ SELECT COUNT(*) FROM xacttest; (1 row) RESET transaction_isolation; -- error -ERROR: parameter "transaction_isolation" cannot be reset +ERROR: parameter transaction_isolation cannot be reset END; BEGIN TRANSACTION READ ONLY; SELECT COUNT(*) FROM xacttest; @@ -63,7 +63,7 @@ SELECT COUNT(*) FROM xacttest; (1 row) RESET transaction_read_only; -- error -ERROR: parameter "transaction_read_only" cannot be reset +ERROR: parameter transaction_read_only cannot be reset END; BEGIN TRANSACTION DEFERRABLE; SELECT COUNT(*) FROM xacttest; @@ -73,11 +73,11 @@ SELECT COUNT(*) FROM xacttest; (1 row) RESET transaction_deferrable; -- error -ERROR: parameter "transaction_deferrable" cannot be reset +ERROR: parameter transaction_deferrable cannot be reset END; CREATE FUNCTION errfunc() RETURNS int LANGUAGE SQL AS 'SELECT 1' SET transaction_read_only = on; -- error -ERROR: parameter "transaction_read_only" cannot be set locally in functions +ERROR: parameter transaction_read_only cannot be set locally in functions -- Read-only tests CREATE TABLE writetest (a int); CREATE TEMPORARY TABLE temptest (a int); diff --git a/contrib/auto_explain/t/001_auto_explain.pl b/contrib/auto_explain/t/001_auto_explain.pl index abb422f8de..056001a0d6 100644 --- a/contrib/auto_explain/t/001_auto_explain.pl +++ b/contrib/auto_explain/t/001_auto_explain.pl @@ -201,7 +201,7 @@ GRANT SET ON PARAMETER auto_explain.log_format TO regress_user1; like( $log_contents, - qr/WARNING: ( 42501:)? permission denied to set parameter "auto_explain\.log_level"/, + qr/WARNING: ( 42501:)? permission denied to set parameter auto_explain\.log_level/, "permission failure logged"); } # end queries run as regress_user1 diff --git a/src/pl/plperl/expected/plperl_init.out b/src/pl/plperl/expected/plperl_init.out index 4b7e925419..6d6825cfed 100644 --- a/src/pl/plperl/expected/plperl_init.out +++ b/src/pl/plperl/expected/plperl_init.out @@ -23,7 +23,7 @@ SET ROLE regress_plperl_user; SET SESSION plperl.on_plperl_init = 'test'; RESET ROLE; LOAD 'plperl'; -WARNING: permission denied to set parameter "plperl.on_plperl_init" +WARNING: permission denied to set parameter plperl.on_plperl_init SHOW plperl.on_plperl_init; plperl.on_plperl_init ----------------------- @@ -35,6 +35,6 @@ WARNING: 42 at line 1. -- now we won't be allowed to set it in the first place SET ROLE regress_plperl_user; SET SESSION plperl.on_plperl_init = 'test'; -ERROR: permission denied to set parameter "plperl.on_plperl_init" +ERROR: permission denied to set parameter plperl.on_plperl_init RESET ROLE; DROP ROLE regress_plperl_user; -- 2.42.0 [application/pgp-signature] signature.asc (833B, ../../[email protected]/3-signature.asc) download ^ permalink raw reply [nested|flat] 21+ messages in thread
* Re: GUC names in messages @ 2023-11-30 06:29 Kyotaro Horiguchi <[email protected]> parent: Michael Paquier <[email protected]> 3 siblings, 1 reply; 21+ messages in thread From: Kyotaro Horiguchi @ 2023-11-30 06:29 UTC (permalink / raw) To: [email protected]; +Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected] At Thu, 30 Nov 2023 14:59:21 +0900, Michael Paquier <[email protected]> wrote in > > Patch 0003 now uses a "%s%s%s" format specifier with GUC_FORMAT macro > > in guc.c, as recently suggested by Michael [1]. > > I cannot think about a better idea as these strings need to be > translated so they need three %s. In this patch, the quotation marks cannot be changed from double quotes. After a brief review of the use of quotation marks in various languages, it's observed that French uses guillemets (« »), German uses lower qutation marks („ “), Spanish uses angular quotation marks (« ») or alternatively, lower quotetaion marks. Japanese commonly uses corner brackets (「」), but can also adopt double or single quotation marks in certain contexts. I took a look at the backend's fr.po file for a trial, and it indeed seems that guillemets are being used. regards. -- Kyotaro Horiguchi NTT Open Source Software Center ^ permalink raw reply [nested|flat] 21+ messages in thread
* Re: GUC names in messages @ 2023-11-30 07:03 Michael Paquier <[email protected]> parent: Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Michael Paquier @ 2023-11-30 07:03 UTC (permalink / raw) To: Kyotaro Horiguchi <[email protected]>; +Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected] On Thu, Nov 30, 2023 at 03:29:49PM +0900, Kyotaro Horiguchi wrote: > In this patch, the quotation marks cannot be changed from double > quotes. Indeed, that's a good point. I completely forgot about that. -- Michael Attachments: [application/pgp-signature] signature.asc (833B, ../../[email protected]/2-signature.asc) download ^ permalink raw reply [nested|flat] 21+ messages in thread
* Re: GUC names in messages @ 2023-11-30 07:39 Peter Smith <[email protected]> parent: Michael Paquier <[email protected]> 3 siblings, 0 replies; 21+ messages in thread From: Peter Smith @ 2023-11-30 07:39 UTC (permalink / raw) To: Michael Paquier <[email protected]>; +Cc: Alvaro Herrera <[email protected]>; Nathan Bossart <[email protected]>; Laurenz Albe <[email protected]>; Peter Eisentraut <[email protected]>; Tom Lane <[email protected]>; Daniel Gustafsson <[email protected]>; PostgreSQL Hackers <[email protected]> On Thu, Nov 30, 2023 at 4:59 PM Michael Paquier <[email protected]> wrote: > > On Tue, Nov 28, 2023 at 11:54:33AM +1100, Peter Smith wrote: > > Here is patch set v3. > > > > Patches 0001 and 0002 are unchanged from v2. > > After some grepping, I've noticed that 0002 had a mistake with > track_commit_timestamp: some alternate output of modules/commit_ts/ > was not updated. meson was able to reproduce the failure as well. > > I am not sure regarding what we should do a mixed cases as well, so I > have discarded DateStyle for now, and applied the rest. > > Also applied 0001 from Alvaro. > Thanks for pushing those parts. > > Patch 0003 now uses a "%s%s%s" format specifier with GUC_FORMAT macro > > in guc.c, as recently suggested by Michael [1]. > > I cannot think about a better idea as these strings need to be > translated so they need three %s. > > + if (*p == '_') > + underscore = true; > + else if ('a' <= *p && *p <= 'z') > + lowercase = true; > > An issue with this code is that it would forget to quote GUCs that use > dots, like the ones from an extension. I don't really see why we > cannot just make the macro return true only if all the characters of a > GUC name is made of lower-case alpha characters? Not forgotten. I felt the dot separator in such names might be mistaken for a period in a sentence which is why I left quotes for those ones. YMMV. ====== Kind Regards, Peter. Smith. Fujitsu Australia ^ permalink raw reply [nested|flat] 21+ messages in thread
* Re: GUC names in messages @ 2023-11-30 10:57 Alvaro Herrera <[email protected]> parent: Michael Paquier <[email protected]> 3 siblings, 0 replies; 21+ messages in thread From: Alvaro Herrera @ 2023-11-30 10:57 UTC (permalink / raw) To: Michael Paquier <[email protected]>; +Cc: Peter Smith <[email protected]>; Nathan Bossart <[email protected]>; Laurenz Albe <[email protected]>; Peter Eisentraut <[email protected]>; Tom Lane <[email protected]>; Daniel Gustafsson <[email protected]>; PostgreSQL Hackers <[email protected]> > +/* > + * Return whether the GUC name should be enclosed in double-quotes. > + * > + * Quoting is intended for names which could be mistaken for normal English > + * words. Quotes are only applied to GUC names that are written entirely with > + * lower-case alphabetical characters. > + */ > +static bool > +quotes_needed_for_GUC_name(const char *name) > +{ > + for (const char *p = name; *p; p++) > + { > + if ('a' > *p || *p > 'z') > + return false; > + } > + > + return true; > +} I think you need a function that the name possibly quoted, in a way that lets the translator handle the quoting: static char buffer[SOMEMAXLEN]; quotes_needed = ...; if (quotes_needed) /* translator: a quoted configuration parameter name */ snprintf(buffer, _("\"%s\""), name); return buffer else /* no translation needed in this case */ return name; then the calling code just does a single %s that prints the string returned by this function. (Do note that the function is not reentrant, like pg_dump's fmtId. Shouldn't be a problem ...) > @@ -3621,8 +3673,8 @@ set_config_option_ext(const char *name, const char *value, > { > if (changeVal && !makeDefault) > { > - elog(DEBUG3, "\"%s\": setting ignored because previous source is higher priority", > - name); > + elog(DEBUG3, "%s%s%s: setting ignored because previous source is higher priority", > + GUC_FORMAT(name)); Note that elog() doesn't do translation, and DEBUG doesn't really need to worry too much about style anyway. I'd leave these as-is. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "La primera ley de las demostraciones en vivo es: no trate de usar el sistema. Escriba un guión que no toque nada para no causar daños." (Jakob Nielsen) ^ permalink raw reply [nested|flat] 21+ messages in thread
* Re: GUC names in messages @ 2023-11-30 20:38 Peter Eisentraut <[email protected]> parent: Michael Paquier <[email protected]> 3 siblings, 1 reply; 21+ messages in thread From: Peter Eisentraut @ 2023-11-30 20:38 UTC (permalink / raw) To: Michael Paquier <[email protected]>; Peter Smith <[email protected]>; +Cc: Alvaro Herrera <[email protected]>; Nathan Bossart <[email protected]>; Laurenz Albe <[email protected]>; Tom Lane <[email protected]>; Daniel Gustafsson <[email protected]>; PostgreSQL Hackers <[email protected]> On 30.11.23 06:59, Michael Paquier wrote: > ereport(elevel, > (errcode(ERRCODE_UNDEFINED_OBJECT), > - errmsg("unrecognized configuration parameter \"%s\" in file \"%s\" line %d", > - item->name, > + /* translator: %s%s%s is for an optionally quoted GUC name */ > + errmsg("unrecognized configuration parameter %s%s%s in file \"%s\" line %d", > + GUC_FORMAT(item->name), > item->filename, item->sourceline))); I think this is completely over-engineered and wrong. If we start down this road, then the next person is going to start engineering some rules by which we should quote file names and other things. Which will lead to more confusion, not less. The whole point of this quoting thing is that you do it all the time or not, not dynamically based on what's inside of it. The original version of this string (and similar ones) seems the most correct, simple, and useful one to me. ^ permalink raw reply [nested|flat] 21+ messages in thread
* Re: GUC names in messages @ 2023-12-08 04:10 Peter Smith <[email protected]> parent: Peter Eisentraut <[email protected]> 0 siblings, 2 replies; 21+ messages in thread From: Peter Smith @ 2023-12-08 04:10 UTC (permalink / raw) To: Peter Eisentraut <[email protected]>; +Cc: Michael Paquier <[email protected]>; Alvaro Herrera <[email protected]>; Nathan Bossart <[email protected]>; Laurenz Albe <[email protected]>; Tom Lane <[email protected]>; Daniel Gustafsson <[email protected]>; PostgreSQL Hackers <[email protected]> On Fri, Dec 1, 2023 at 7:38 AM Peter Eisentraut <[email protected]> wrote: > > On 30.11.23 06:59, Michael Paquier wrote: > > ereport(elevel, > > (errcode(ERRCODE_UNDEFINED_OBJECT), > > - errmsg("unrecognized configuration parameter \"%s\" in file \"%s\" line %d", > > - item->name, > > + /* translator: %s%s%s is for an optionally quoted GUC name */ > > + errmsg("unrecognized configuration parameter %s%s%s in file \"%s\" line %d", > > + GUC_FORMAT(item->name), > > item->filename, item->sourceline))); > > I think this is completely over-engineered and wrong. If we start down > this road, then the next person is going to start engineering some rules > by which we should quote file names and other things. Which will lead > to more confusion, not less. The whole point of this quoting thing is > that you do it all the time or not, not dynamically based on what's > inside of it. > > The original version of this string (and similar ones) seems the most > correct, simple, and useful one to me. > Yeah, trying to manipulate the quoting dynamically seems like it was an overreach... Removing that still leaves some other changes needed to "fix" the messages using MixedCase GUCs. PSA v4 ====== Details: Patch 0001 -- "datestyle" becomes DateStyle in messages Rebased this again, which was part of an earlier patch set - I think any GUC names documented as MixedCase should keep that same case in messages; this also obeys the guidelines recently pushed [1]. - Some others agreed, expecting the exact GUC name (in the message) can be found in pg_settings [2]. - OTOH, Michael didn't like the diff churn [3] caused by this patch. ~~~ Patch 0002 -- use mixed case for intervalstyle error message I found that the GUC name substituted to the error message was coming from the statement, not from the original name in the guc_tables, so there was a case mismatch: BEFORE Patch 0002 (see the lowercase in the error message) 2023-12-08 13:21:32.897 AEDT [32609] STATEMENT: set intervalstyle = 1234; ERROR: invalid value for parameter "intervalstyle": "1234" HINT: Available values: postgres, postgres_verbose, sql_standard, iso_8601. AFTER Patch 0002 2023-12-08 13:38:48.638 AEDT [29684] STATEMENT: set intervalstyle = 1234; ERROR: invalid value for parameter "IntervalStyle": "1234" HINT: Available values: postgres, postgres_verbose, sql_standard, iso_8601. ====== [1] GUC quoting guidelines - https://github.com/postgres/postgres/commit/a243569bf65c5664436e8f63d870b7ee9c014dcb [2] The case should match pg_settings - https://www.postgresql.org/message-id/db3e4290ced77111c17e7a2adfb1d660734f5f78.camel%40cybertec.at [3] Dislike of diff churn - https://www.postgresql.org/message-id/ZWUd8dYYA9v83KvI%40paquier.xyz Kind Regards, Peter Smith. Fujitsu Australia Attachments: [application/octet-stream] v4-0002-GUC-names-use-mixed-case-for-intervalstyle-error-.patch (853B, ../../CAHut+Ps3Lbo=hGevYf8AyjFo8+=SSwXUo7onB-6nS6e-Q-bQoQ@mail.gmail.com/2-v4-0002-GUC-names-use-mixed-case-for-intervalstyle-error-.patch) download | inline diff: From f2755db57e375bc07226438faac83ea789ecf9fd Mon Sep 17 00:00:00 2001 From: Peter Smith <[email protected]> Date: Fri, 8 Dec 2023 14:41:02 +1100 Subject: [PATCH v4] GUC names - use mixed case for intervalstyle error message --- src/backend/utils/misc/guc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index e76c083..c134024 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -3252,7 +3252,7 @@ parse_and_validate_value(struct config_generic *record, ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("invalid value for parameter \"%s\": \"%s\"", - name, value), + conf->gen.name, value), hintmsg ? errhint("%s", _(hintmsg)) : 0)); if (hintmsg) -- 1.8.3.1 [application/octet-stream] v4-0001-GUC-names-use-mixed-case-for-datestyle-in-message.patch (11.1K, ../../CAHut+Ps3Lbo=hGevYf8AyjFo8+=SSwXUo7onB-6nS6e-Q-bQoQ@mail.gmail.com/3-v4-0001-GUC-names-use-mixed-case-for-datestyle-in-message.patch) download | inline diff: From 663701868262f892f42ccbe2c10c9c42ff25d998 Mon Sep 17 00:00:00 2001 From: Peter Smith <[email protected]> Date: Fri, 8 Dec 2023 12:59:20 +1100 Subject: [PATCH v4] GUC names - use mixed case for datestyle in messages --- src/backend/commands/variable.c | 2 +- src/backend/utils/adt/datetime.c | 2 +- src/test/regress/expected/date.out | 58 +++++++++++++++++----------------- src/test/regress/expected/horology.out | 2 +- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c index c361bb2..2703d2e 100644 --- a/src/backend/commands/variable.c +++ b/src/backend/commands/variable.c @@ -182,7 +182,7 @@ check_datestyle(char **newval, void **extra, GucSource source) if (!ok) { - GUC_check_errdetail("Conflicting \"datestyle\" specifications."); + GUC_check_errdetail("Conflicting DateStyle specifications."); return false; } diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c index fca9a2a..8ef5bf0 100644 --- a/src/backend/utils/adt/datetime.c +++ b/src/backend/utils/adt/datetime.c @@ -4022,7 +4022,7 @@ DateTimeParseError(int dterr, DateTimeErrorExtra *extra, (errcode(ERRCODE_DATETIME_FIELD_OVERFLOW), errmsg("date/time field value out of range: \"%s\"", str), - errhint("Perhaps you need a different \"datestyle\" setting."))); + errhint("Perhaps you need a different DateStyle setting."))); break; case DTERR_INTERVAL_OVERFLOW: errsave(escontext, diff --git a/src/test/regress/expected/date.out b/src/test/regress/expected/date.out index f5949f3..99650bf 100644 --- a/src/test/regress/expected/date.out +++ b/src/test/regress/expected/date.out @@ -94,17 +94,17 @@ SELECT date '1/8/1999'; ERROR: date/time field value out of range: "1/8/1999" LINE 1: SELECT date '1/8/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1/18/1999'; ERROR: date/time field value out of range: "1/18/1999" LINE 1: SELECT date '1/18/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '18/1/1999'; ERROR: date/time field value out of range: "18/1/1999" LINE 1: SELECT date '18/1/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01/02/03'; date ------------ @@ -139,7 +139,7 @@ SELECT date 'January 8, 99 BC'; ERROR: date/time field value out of range: "January 8, 99 BC" LINE 1: SELECT date 'January 8, 99 BC'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '99-Jan-08'; date ------------ @@ -156,7 +156,7 @@ SELECT date '08-Jan-99'; ERROR: date/time field value out of range: "08-Jan-99" LINE 1: SELECT date '08-Jan-99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '08-Jan-1999'; date ------------ @@ -167,7 +167,7 @@ SELECT date 'Jan-08-99'; ERROR: date/time field value out of range: "Jan-08-99" LINE 1: SELECT date 'Jan-08-99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date 'Jan-08-1999'; date ------------ @@ -198,7 +198,7 @@ SELECT date '08 Jan 99'; ERROR: date/time field value out of range: "08 Jan 99" LINE 1: SELECT date '08 Jan 99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '08 Jan 1999'; date ------------ @@ -209,7 +209,7 @@ SELECT date 'Jan 08 99'; ERROR: date/time field value out of range: "Jan 08 99" LINE 1: SELECT date 'Jan 08 99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date 'Jan 08 1999'; date ------------ @@ -244,22 +244,22 @@ SELECT date '08-01-99'; ERROR: date/time field value out of range: "08-01-99" LINE 1: SELECT date '08-01-99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '08-01-1999'; ERROR: date/time field value out of range: "08-01-1999" LINE 1: SELECT date '08-01-1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01-08-99'; ERROR: date/time field value out of range: "01-08-99" LINE 1: SELECT date '01-08-99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01-08-1999'; ERROR: date/time field value out of range: "01-08-1999" LINE 1: SELECT date '01-08-1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '99-08-01'; date ------------ @@ -288,22 +288,22 @@ SELECT date '08 01 99'; ERROR: date/time field value out of range: "08 01 99" LINE 1: SELECT date '08 01 99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '08 01 1999'; ERROR: date/time field value out of range: "08 01 1999" LINE 1: SELECT date '08 01 1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01 08 99'; ERROR: date/time field value out of range: "01 08 99" LINE 1: SELECT date '01 08 99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01 08 1999'; ERROR: date/time field value out of range: "01 08 1999" LINE 1: SELECT date '01 08 1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '99 08 01'; date ------------ @@ -345,7 +345,7 @@ SELECT date '1/18/1999'; ERROR: date/time field value out of range: "1/18/1999" LINE 1: SELECT date '1/18/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '18/1/1999'; date ------------ @@ -392,7 +392,7 @@ SELECT date '99-Jan-08'; ERROR: date/time field value out of range: "99-Jan-08" LINE 1: SELECT date '99-Jan-08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-Jan-08'; date ------------ @@ -435,7 +435,7 @@ SELECT date '99 Jan 08'; ERROR: date/time field value out of range: "99 Jan 08" LINE 1: SELECT date '99 Jan 08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 Jan 08'; date ------------ @@ -480,7 +480,7 @@ SELECT date '99-01-08'; ERROR: date/time field value out of range: "99-01-08" LINE 1: SELECT date '99-01-08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-01-08'; date ------------ @@ -515,7 +515,7 @@ SELECT date '99-08-01'; ERROR: date/time field value out of range: "99-08-01" LINE 1: SELECT date '99-08-01'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-08-01'; date ------------ @@ -526,7 +526,7 @@ SELECT date '99 01 08'; ERROR: date/time field value out of range: "99 01 08" LINE 1: SELECT date '99 01 08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 01 08'; date ------------ @@ -561,7 +561,7 @@ SELECT date '99 08 01'; ERROR: date/time field value out of range: "99 08 01" LINE 1: SELECT date '99 08 01'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 08 01'; date ------------ @@ -603,7 +603,7 @@ SELECT date '18/1/1999'; ERROR: date/time field value out of range: "18/1/1999" LINE 1: SELECT date '18/1/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01/02/03'; date ------------ @@ -644,7 +644,7 @@ SELECT date '99-Jan-08'; ERROR: date/time field value out of range: "99-Jan-08" LINE 1: SELECT date '99-Jan-08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-Jan-08'; date ------------ @@ -731,7 +731,7 @@ SELECT date '99-01-08'; ERROR: date/time field value out of range: "99-01-08" LINE 1: SELECT date '99-01-08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-01-08'; date ------------ @@ -766,7 +766,7 @@ SELECT date '99-08-01'; ERROR: date/time field value out of range: "99-08-01" LINE 1: SELECT date '99-08-01'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-08-01'; date ------------ @@ -777,7 +777,7 @@ SELECT date '99 01 08'; ERROR: date/time field value out of range: "99 01 08" LINE 1: SELECT date '99 01 08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 01 08'; date ------------ @@ -812,7 +812,7 @@ SELECT date '99 08 01'; ERROR: date/time field value out of range: "99 08 01" LINE 1: SELECT date '99 08 01'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 08 01'; date ------------ diff --git a/src/test/regress/expected/horology.out b/src/test/regress/expected/horology.out index cfb4b20..4aeefd5 100644 --- a/src/test/regress/expected/horology.out +++ b/src/test/regress/expected/horology.out @@ -100,7 +100,7 @@ SELECT timestamp with time zone '27/12/2001 04:05:06.789-08'; ERROR: date/time field value out of range: "27/12/2001 04:05:06.789-08" LINE 1: SELECT timestamp with time zone '27/12/2001 04:05:06.789-08'... ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. set datestyle to dmy; SELECT timestamp with time zone '27/12/2001 04:05:06.789-08'; timestamptz -- 1.8.3.1 ^ permalink raw reply [nested|flat] 21+ messages in thread
* Re: GUC names in messages @ 2023-12-08 12:55 Alvaro Herrera <[email protected]> parent: Peter Smith <[email protected]> 1 sibling, 0 replies; 21+ messages in thread From: Alvaro Herrera @ 2023-12-08 12:55 UTC (permalink / raw) To: Peter Smith <[email protected]>; +Cc: Peter Eisentraut <[email protected]>; Michael Paquier <[email protected]>; Nathan Bossart <[email protected]>; Laurenz Albe <[email protected]>; Tom Lane <[email protected]>; Daniel Gustafsson <[email protected]>; PostgreSQL Hackers <[email protected]> On 2023-Dec-08, Peter Smith wrote: > Patch 0001 -- "datestyle" becomes DateStyle in messages > Rebased this again, which was part of an earlier patch set > - I think any GUC names documented as MixedCase should keep that same > case in messages; this also obeys the guidelines recently pushed [1]. I agree. > Patch 0002 -- use mixed case for intervalstyle error message > I found that the GUC name substituted to the error message was coming > from the statement, not from the original name in the guc_tables, so > there was a case mismatch: I agree. Let's also add a test that shows this difference (my 0002 here). I'm annoyed that this saga has transiently created a few untranslated strings by removing unnecessary quotes but failing to move the variable names outside the translatable part of the string. I change a few of those in 0003 -- mostly the ones in strings already touched by commit 8d9978a7176a, but also a few others. Didn't go out of my way to grep for other possible messages to fix, though. (I feel like this is missing some "translator:" comments.) -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "We’ve narrowed the problem down to the customer’s pants being in a situation of vigorous combustion" (Robert Haas, Postgres expert extraordinaire) Attachments: [text/x-diff] v5-0001-GUC-names-use-mixed-case-for-datestyle-in-message.patch (11.1K, ../../[email protected]/2-v5-0001-GUC-names-use-mixed-case-for-datestyle-in-message.patch) download | inline diff: From 0ccf4f8342d49d42116a1b1b872b15aeeddaf568 Mon Sep 17 00:00:00 2001 From: Peter Smith <[email protected]> Date: Fri, 8 Dec 2023 12:59:20 +1100 Subject: [PATCH v5 1/3] GUC names - use mixed case for datestyle in messages --- src/backend/commands/variable.c | 2 +- src/backend/utils/adt/datetime.c | 2 +- src/test/regress/expected/date.out | 58 +++++++++++++------------- src/test/regress/expected/horology.out | 2 +- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c index c361bb2079..2703d2edc4 100644 --- a/src/backend/commands/variable.c +++ b/src/backend/commands/variable.c @@ -182,7 +182,7 @@ check_datestyle(char **newval, void **extra, GucSource source) if (!ok) { - GUC_check_errdetail("Conflicting \"datestyle\" specifications."); + GUC_check_errdetail("Conflicting DateStyle specifications."); return false; } diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c index fca9a2a6e9..8ef5bf0076 100644 --- a/src/backend/utils/adt/datetime.c +++ b/src/backend/utils/adt/datetime.c @@ -4022,7 +4022,7 @@ DateTimeParseError(int dterr, DateTimeErrorExtra *extra, (errcode(ERRCODE_DATETIME_FIELD_OVERFLOW), errmsg("date/time field value out of range: \"%s\"", str), - errhint("Perhaps you need a different \"datestyle\" setting."))); + errhint("Perhaps you need a different DateStyle setting."))); break; case DTERR_INTERVAL_OVERFLOW: errsave(escontext, diff --git a/src/test/regress/expected/date.out b/src/test/regress/expected/date.out index f5949f3d17..99650bf231 100644 --- a/src/test/regress/expected/date.out +++ b/src/test/regress/expected/date.out @@ -94,17 +94,17 @@ SELECT date '1/8/1999'; ERROR: date/time field value out of range: "1/8/1999" LINE 1: SELECT date '1/8/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1/18/1999'; ERROR: date/time field value out of range: "1/18/1999" LINE 1: SELECT date '1/18/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '18/1/1999'; ERROR: date/time field value out of range: "18/1/1999" LINE 1: SELECT date '18/1/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01/02/03'; date ------------ @@ -139,7 +139,7 @@ SELECT date 'January 8, 99 BC'; ERROR: date/time field value out of range: "January 8, 99 BC" LINE 1: SELECT date 'January 8, 99 BC'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '99-Jan-08'; date ------------ @@ -156,7 +156,7 @@ SELECT date '08-Jan-99'; ERROR: date/time field value out of range: "08-Jan-99" LINE 1: SELECT date '08-Jan-99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '08-Jan-1999'; date ------------ @@ -167,7 +167,7 @@ SELECT date 'Jan-08-99'; ERROR: date/time field value out of range: "Jan-08-99" LINE 1: SELECT date 'Jan-08-99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date 'Jan-08-1999'; date ------------ @@ -198,7 +198,7 @@ SELECT date '08 Jan 99'; ERROR: date/time field value out of range: "08 Jan 99" LINE 1: SELECT date '08 Jan 99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '08 Jan 1999'; date ------------ @@ -209,7 +209,7 @@ SELECT date 'Jan 08 99'; ERROR: date/time field value out of range: "Jan 08 99" LINE 1: SELECT date 'Jan 08 99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date 'Jan 08 1999'; date ------------ @@ -244,22 +244,22 @@ SELECT date '08-01-99'; ERROR: date/time field value out of range: "08-01-99" LINE 1: SELECT date '08-01-99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '08-01-1999'; ERROR: date/time field value out of range: "08-01-1999" LINE 1: SELECT date '08-01-1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01-08-99'; ERROR: date/time field value out of range: "01-08-99" LINE 1: SELECT date '01-08-99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01-08-1999'; ERROR: date/time field value out of range: "01-08-1999" LINE 1: SELECT date '01-08-1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '99-08-01'; date ------------ @@ -288,22 +288,22 @@ SELECT date '08 01 99'; ERROR: date/time field value out of range: "08 01 99" LINE 1: SELECT date '08 01 99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '08 01 1999'; ERROR: date/time field value out of range: "08 01 1999" LINE 1: SELECT date '08 01 1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01 08 99'; ERROR: date/time field value out of range: "01 08 99" LINE 1: SELECT date '01 08 99'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01 08 1999'; ERROR: date/time field value out of range: "01 08 1999" LINE 1: SELECT date '01 08 1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '99 08 01'; date ------------ @@ -345,7 +345,7 @@ SELECT date '1/18/1999'; ERROR: date/time field value out of range: "1/18/1999" LINE 1: SELECT date '1/18/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '18/1/1999'; date ------------ @@ -392,7 +392,7 @@ SELECT date '99-Jan-08'; ERROR: date/time field value out of range: "99-Jan-08" LINE 1: SELECT date '99-Jan-08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-Jan-08'; date ------------ @@ -435,7 +435,7 @@ SELECT date '99 Jan 08'; ERROR: date/time field value out of range: "99 Jan 08" LINE 1: SELECT date '99 Jan 08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 Jan 08'; date ------------ @@ -480,7 +480,7 @@ SELECT date '99-01-08'; ERROR: date/time field value out of range: "99-01-08" LINE 1: SELECT date '99-01-08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-01-08'; date ------------ @@ -515,7 +515,7 @@ SELECT date '99-08-01'; ERROR: date/time field value out of range: "99-08-01" LINE 1: SELECT date '99-08-01'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-08-01'; date ------------ @@ -526,7 +526,7 @@ SELECT date '99 01 08'; ERROR: date/time field value out of range: "99 01 08" LINE 1: SELECT date '99 01 08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 01 08'; date ------------ @@ -561,7 +561,7 @@ SELECT date '99 08 01'; ERROR: date/time field value out of range: "99 08 01" LINE 1: SELECT date '99 08 01'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 08 01'; date ------------ @@ -603,7 +603,7 @@ SELECT date '18/1/1999'; ERROR: date/time field value out of range: "18/1/1999" LINE 1: SELECT date '18/1/1999'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '01/02/03'; date ------------ @@ -644,7 +644,7 @@ SELECT date '99-Jan-08'; ERROR: date/time field value out of range: "99-Jan-08" LINE 1: SELECT date '99-Jan-08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-Jan-08'; date ------------ @@ -731,7 +731,7 @@ SELECT date '99-01-08'; ERROR: date/time field value out of range: "99-01-08" LINE 1: SELECT date '99-01-08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-01-08'; date ------------ @@ -766,7 +766,7 @@ SELECT date '99-08-01'; ERROR: date/time field value out of range: "99-08-01" LINE 1: SELECT date '99-08-01'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999-08-01'; date ------------ @@ -777,7 +777,7 @@ SELECT date '99 01 08'; ERROR: date/time field value out of range: "99 01 08" LINE 1: SELECT date '99 01 08'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 01 08'; date ------------ @@ -812,7 +812,7 @@ SELECT date '99 08 01'; ERROR: date/time field value out of range: "99 08 01" LINE 1: SELECT date '99 08 01'; ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. SELECT date '1999 08 01'; date ------------ diff --git a/src/test/regress/expected/horology.out b/src/test/regress/expected/horology.out index cfb4b205e4..4aeefd53bd 100644 --- a/src/test/regress/expected/horology.out +++ b/src/test/regress/expected/horology.out @@ -100,7 +100,7 @@ SELECT timestamp with time zone '27/12/2001 04:05:06.789-08'; ERROR: date/time field value out of range: "27/12/2001 04:05:06.789-08" LINE 1: SELECT timestamp with time zone '27/12/2001 04:05:06.789-08'... ^ -HINT: Perhaps you need a different "datestyle" setting. +HINT: Perhaps you need a different DateStyle setting. set datestyle to dmy; SELECT timestamp with time zone '27/12/2001 04:05:06.789-08'; timestamptz -- 2.39.2 [text/x-diff] v5-0002-Ensure-we-use-documented-CamelCase-in-error-messa.patch (1.9K, ../../[email protected]/3-v5-0002-Ensure-we-use-documented-CamelCase-in-error-messa.patch) download | inline diff: From 8b5bd09c818590afd858b9c8159887339db8e456 Mon Sep 17 00:00:00 2001 From: Peter Smith <[email protected]> Date: Fri, 8 Dec 2023 14:41:02 +1100 Subject: [PATCH v5 2/3] Ensure we use documented CamelCase in error messages Author: Peter Smith --- src/backend/utils/misc/guc.c | 2 +- src/test/regress/expected/guc.out | 4 ++++ src/test/regress/sql/guc.sql | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index e76c083003..c134024fd5 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -3252,7 +3252,7 @@ parse_and_validate_value(struct config_generic *record, ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("invalid value for parameter \"%s\": \"%s\"", - name, value), + conf->gen.name, value), hintmsg ? errhint("%s", _(hintmsg)) : 0)); if (hintmsg) diff --git a/src/test/regress/expected/guc.out b/src/test/regress/expected/guc.out index 127c953297..66ddc4c938 100644 --- a/src/test/regress/expected/guc.out +++ b/src/test/regress/expected/guc.out @@ -6,6 +6,10 @@ SHOW datestyle; Postgres, MDY (1 row) +-- Check output style of CamelCase enum options +SET intervalstyle to 'asd'; +ERROR: invalid value for parameter "IntervalStyle": "asd" +HINT: Available values: postgres, postgres_verbose, sql_standard, iso_8601. -- SET to some nondefault value SET vacuum_cost_delay TO 40; SET datestyle = 'ISO, YMD'; diff --git a/src/test/regress/sql/guc.sql b/src/test/regress/sql/guc.sql index dc79761955..e540495fc1 100644 --- a/src/test/regress/sql/guc.sql +++ b/src/test/regress/sql/guc.sql @@ -2,6 +2,9 @@ -- we can't rely on any specific default value of vacuum_cost_delay SHOW datestyle; +-- Check output style of CamelCase enum options +SET intervalstyle to 'asd'; + -- SET to some nondefault value SET vacuum_cost_delay TO 40; SET datestyle = 'ISO, YMD'; -- 2.39.2 [text/x-diff] v5-0003-move-variable-names-out-of-translatable-message-s.patch (20.7K, ../../[email protected]/4-v5-0003-move-variable-names-out-of-translatable-message-s.patch) download | inline diff: From 86402523bc1783d8cc508418bb4be796d3aa7dae Mon Sep 17 00:00:00 2001 From: Alvaro Herrera <[email protected]> Date: Fri, 8 Dec 2023 13:46:41 +0100 Subject: [PATCH v5 3/3] move variable names out of translatable message string --- contrib/pg_prewarm/autoprewarm.c | 3 +- src/backend/access/transam/xlog.c | 75 +++++++++++++---------- src/backend/access/transam/xlogrecovery.c | 2 +- src/backend/commands/vacuum.c | 10 +-- src/backend/commands/variable.c | 11 ++-- src/backend/port/sysv_shmem.c | 3 +- src/backend/postmaster/bgworker.c | 3 +- src/backend/postmaster/checkpointer.c | 3 +- src/backend/replication/syncrep.c | 3 +- src/backend/storage/buffer/localbuf.c | 3 +- src/backend/storage/file/fd.c | 9 ++- src/backend/storage/lmgr/predicate.c | 6 +- src/backend/tcop/postgres.c | 15 +++-- src/backend/utils/fmgr/dfmgr.c | 16 ++--- 14 files changed, 97 insertions(+), 65 deletions(-) diff --git a/contrib/pg_prewarm/autoprewarm.c b/contrib/pg_prewarm/autoprewarm.c index 0993bd2453..fcc8debb0b 100644 --- a/contrib/pg_prewarm/autoprewarm.c +++ b/contrib/pg_prewarm/autoprewarm.c @@ -877,7 +877,8 @@ apw_start_database_worker(void) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_RESOURCES), errmsg("registering dynamic bgworker autoprewarm failed"), - errhint("Consider increasing configuration parameter max_worker_processes."))); + errhint("Consider increasing the configuration parameter %s.", + "max_worker_processes"))); /* * Ignore return value; if it fails, postmaster has died, but we have diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index daed1a7a49..d3831ea978 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -4161,16 +4161,21 @@ ReadControlFile(void) if (ControlFile->catalog_version_no != CATALOG_VERSION_NO) ereport(FATAL, (errmsg("database files are incompatible with server"), - errdetail("The database cluster was initialized with CATALOG_VERSION_NO %d," - " but the server was compiled with CATALOG_VERSION_NO %d.", - ControlFile->catalog_version_no, CATALOG_VERSION_NO), + /*- translator: %s is a variable name and %d is its value */ + errdetail("The database cluster was initialized with %s %d," + " but the server was compiled with %s %d.", + "CATALOG_VERSION_NO", + ControlFile->catalog_version_no, + "CATALOG_VERSION_NO", + CATALOG_VERSION_NO), errhint("It looks like you need to initdb."))); if (ControlFile->maxAlign != MAXIMUM_ALIGNOF) ereport(FATAL, (errmsg("database files are incompatible with server"), - errdetail("The database cluster was initialized with MAXALIGN %d," - " but the server was compiled with MAXALIGN %d.", - ControlFile->maxAlign, MAXIMUM_ALIGNOF), + errdetail("The database cluster was initialized with %s %d," + " but the server was compiled with %s %d.", + "MAXALIGN", ControlFile->maxAlign, + "MAXALIGN", MAXIMUM_ALIGNOF), errhint("It looks like you need to initdb."))); if (ControlFile->floatFormat != FLOATFORMAT_VALUE) ereport(FATAL, @@ -4180,51 +4185,57 @@ ReadControlFile(void) if (ControlFile->blcksz != BLCKSZ) ereport(FATAL, (errmsg("database files are incompatible with server"), - errdetail("The database cluster was initialized with BLCKSZ %d," - " but the server was compiled with BLCKSZ %d.", - ControlFile->blcksz, BLCKSZ), + errdetail("The database cluster was initialized with %s %d," + " but the server was compiled with %s %d.", + "BLCKSZ", ControlFile->blcksz, "BLCKSZ", BLCKSZ), errhint("It looks like you need to recompile or initdb."))); if (ControlFile->relseg_size != RELSEG_SIZE) ereport(FATAL, (errmsg("database files are incompatible with server"), - errdetail("The database cluster was initialized with RELSEG_SIZE %d," - " but the server was compiled with RELSEG_SIZE %d.", - ControlFile->relseg_size, RELSEG_SIZE), + errdetail("The database cluster was initialized with %s %d," + " but the server was compiled with %s %d.", + "RELSEG_SIZE", ControlFile->relseg_size, + "RELSEG_SIZE", RELSEG_SIZE), errhint("It looks like you need to recompile or initdb."))); if (ControlFile->xlog_blcksz != XLOG_BLCKSZ) ereport(FATAL, (errmsg("database files are incompatible with server"), - errdetail("The database cluster was initialized with XLOG_BLCKSZ %d," - " but the server was compiled with XLOG_BLCKSZ %d.", - ControlFile->xlog_blcksz, XLOG_BLCKSZ), + errdetail("The database cluster was initialized with %s %d," + " but the server was compiled with %s %d.", + "XLOG_BLCKSZ", ControlFile->xlog_blcksz, + "XLOG_BLCKSZ", XLOG_BLCKSZ), errhint("It looks like you need to recompile or initdb."))); if (ControlFile->nameDataLen != NAMEDATALEN) ereport(FATAL, (errmsg("database files are incompatible with server"), - errdetail("The database cluster was initialized with NAMEDATALEN %d," - " but the server was compiled with NAMEDATALEN %d.", - ControlFile->nameDataLen, NAMEDATALEN), + errdetail("The database cluster was initialized with %s %d," + " but the server was compiled with %s %d.", + "NAMEDATALEN", ControlFile->nameDataLen, + "NAMEDATALEN", NAMEDATALEN), errhint("It looks like you need to recompile or initdb."))); if (ControlFile->indexMaxKeys != INDEX_MAX_KEYS) ereport(FATAL, (errmsg("database files are incompatible with server"), - errdetail("The database cluster was initialized with INDEX_MAX_KEYS %d," - " but the server was compiled with INDEX_MAX_KEYS %d.", - ControlFile->indexMaxKeys, INDEX_MAX_KEYS), + errdetail("The database cluster was initialized with %s %d," + " but the server was compiled with %s %d.", + "INDEX_MAX_KEYS", ControlFile->indexMaxKeys, + "INDEX_MAX_KEYS", INDEX_MAX_KEYS), errhint("It looks like you need to recompile or initdb."))); if (ControlFile->toast_max_chunk_size != TOAST_MAX_CHUNK_SIZE) ereport(FATAL, (errmsg("database files are incompatible with server"), - errdetail("The database cluster was initialized with TOAST_MAX_CHUNK_SIZE %d," - " but the server was compiled with TOAST_MAX_CHUNK_SIZE %d.", - ControlFile->toast_max_chunk_size, (int) TOAST_MAX_CHUNK_SIZE), + errdetail("The database cluster was initialized with %s %d," + " but the server was compiled with %s %d.", + "TOAST_MAX_CHUNK_SIZE", ControlFile->toast_max_chunk_size, + "TOAST_MAX_CHUNK_SIZE", (int) TOAST_MAX_CHUNK_SIZE), errhint("It looks like you need to recompile or initdb."))); if (ControlFile->loblksize != LOBLKSIZE) ereport(FATAL, (errmsg("database files are incompatible with server"), - errdetail("The database cluster was initialized with LOBLKSIZE %d," - " but the server was compiled with LOBLKSIZE %d.", - ControlFile->loblksize, (int) LOBLKSIZE), + errdetail("The database cluster was initialized with %s %d," + " but the server was compiled with %s %d.", + "LOBLKSIZE", ControlFile->loblksize, + "LOBLKSIZE", (int) LOBLKSIZE), errhint("It looks like you need to recompile or initdb."))); #ifdef USE_FLOAT8_BYVAL @@ -4259,12 +4270,14 @@ ReadControlFile(void) /* check and update variables dependent on wal_segment_size */ if (ConvertToXSegs(min_wal_size_mb, wal_segment_size) < 2) - ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("min_wal_size must be at least twice wal_segment_size"))); + ereport(ERROR, errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("%s must be at least twice %s", + "min_wal_size", "wal_segment_size")); if (ConvertToXSegs(max_wal_size_mb, wal_segment_size) < 2) - ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("max_wal_size must be at least twice wal_segment_size"))); + ereport(ERROR, errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("%s must be at least twice %s", + "max_wal_size", "wal_segment_size")); UsableBytesInSegment = (wal_segment_size / XLOG_BLCKSZ * UsableBytesInPage) - diff --git a/src/backend/access/transam/xlogrecovery.c b/src/backend/access/transam/xlogrecovery.c index 4bc4d3e323..524d792ae9 100644 --- a/src/backend/access/transam/xlogrecovery.c +++ b/src/backend/access/transam/xlogrecovery.c @@ -4726,7 +4726,7 @@ check_recovery_target(char **newval, void **extra, GucSource source) { if (strcmp(*newval, "immediate") != 0 && strcmp(*newval, "") != 0) { - GUC_check_errdetail("The only allowed value is \"immediate\"."); + GUC_check_errdetail("The only allowed value is \"%s\".", "immediate"); return false; } return true; diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index be43b46c04..a80438f30b 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -134,8 +134,9 @@ check_vacuum_buffer_usage_limit(int *newval, void **extra, return true; /* Value does not fall within any allowable range */ - GUC_check_errdetail("vacuum_buffer_usage_limit must be 0 or between %d kB and %d kB", - MIN_BAS_VAC_RING_SIZE_KB, MAX_BAS_VAC_RING_SIZE_KB); + GUC_check_errdetail("%s must be 0 or between %d kB and %d kB.", + "vacuum_buffer_usage_limit", MIN_BAS_VAC_RING_SIZE_KB, + MAX_BAS_VAC_RING_SIZE_KB); return false; } @@ -206,8 +207,9 @@ ExecVacuum(ParseState *pstate, VacuumStmt *vacstmt, bool isTopLevel) { ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("BUFFER_USAGE_LIMIT option must be 0 or between %d kB and %d kB", - MIN_BAS_VAC_RING_SIZE_KB, MAX_BAS_VAC_RING_SIZE_KB), + errmsg("%s option must be 0 or between %d kB and %d kB", + "BUFFER_USAGE_LIMIT", MIN_BAS_VAC_RING_SIZE_KB, + MAX_BAS_VAC_RING_SIZE_KB), hintmsg ? errhint("%s", _(hintmsg)) : 0)); } diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c index 2703d2edc4..da5e2de310 100644 --- a/src/backend/commands/variable.c +++ b/src/backend/commands/variable.c @@ -182,7 +182,7 @@ check_datestyle(char **newval, void **extra, GucSource source) if (!ok) { - GUC_check_errdetail("Conflicting DateStyle specifications."); + GUC_check_errdetail("Conflicting %s specifications.", "DateStyle"); return false; } @@ -717,7 +717,8 @@ check_client_encoding(char **newval, void **extra, GucSource source) else { /* Provide a useful complaint */ - GUC_check_errdetail("Cannot change client_encoding now."); + GUC_check_errdetail("Cannot change %s now.", + "client_encoding"); } return false; } @@ -1202,7 +1203,8 @@ check_effective_io_concurrency(int *newval, void **extra, GucSource source) #ifndef USE_PREFETCH if (*newval != 0) { - GUC_check_errdetail("effective_io_concurrency must be set to 0 on platforms that lack posix_fadvise()."); + GUC_check_errdetail("%s must be set to 0 on platforms that lack posix_fadvise().", + "effective_io_concurrency"); return false; } #endif /* USE_PREFETCH */ @@ -1215,7 +1217,8 @@ check_maintenance_io_concurrency(int *newval, void **extra, GucSource source) #ifndef USE_PREFETCH if (*newval != 0) { - GUC_check_errdetail("maintenance_io_concurrency must be set to 0 on platforms that lack posix_fadvise()."); + GUC_check_errdetail("%s must be set to 0 on platforms that lack posix_fadvise().", + "maintenance_io_concurrency"); return false; } #endif /* USE_PREFETCH */ diff --git a/src/backend/port/sysv_shmem.c b/src/backend/port/sysv_shmem.c index 2de280ecb6..88c39f577d 100644 --- a/src/backend/port/sysv_shmem.c +++ b/src/backend/port/sysv_shmem.c @@ -580,7 +580,8 @@ check_huge_page_size(int *newval, void **extra, GucSource source) /* Recent enough Linux only, for now. See GetHugePageSize(). */ if (*newval != 0) { - GUC_check_errdetail("huge_page_size must be 0 on this platform."); + GUC_check_errdetail("%s must be 0 on this platform.", + "huge_page_size"); return false; } #endif diff --git a/src/backend/postmaster/bgworker.c b/src/backend/postmaster/bgworker.c index c345639086..f2dc53ac85 100644 --- a/src/backend/postmaster/bgworker.c +++ b/src/backend/postmaster/bgworker.c @@ -919,7 +919,8 @@ RegisterBackgroundWorker(BackgroundWorker *worker) "Up to %d background workers can be registered with the current settings.", max_worker_processes, max_worker_processes), - errhint("Consider increasing the configuration parameter max_worker_processes."))); + errhint("Consider increasing the configuration parameter %s.", + "max_worker_processes"))); return; } diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c index dc2da5a2cd..9060eeea67 100644 --- a/src/backend/postmaster/checkpointer.c +++ b/src/backend/postmaster/checkpointer.c @@ -423,7 +423,8 @@ CheckpointerMain(void) "checkpoints are occurring too frequently (%d seconds apart)", elapsed_secs, elapsed_secs), - errhint("Consider increasing the configuration parameter max_wal_size."))); + errhint("Consider increasing the configuration parameter %s.", + "max_wal_size"))); /* * Initialize checkpointer-private variables used during diff --git a/src/backend/replication/syncrep.c b/src/backend/replication/syncrep.c index 0ea71b5c43..7d1fecb607 100644 --- a/src/backend/replication/syncrep.c +++ b/src/backend/replication/syncrep.c @@ -1016,7 +1016,8 @@ check_synchronous_standby_names(char **newval, void **extra, GucSource source) if (syncrep_parse_error_msg) GUC_check_errdetail("%s", syncrep_parse_error_msg); else - GUC_check_errdetail("synchronous_standby_names parser failed"); + GUC_check_errdetail("%s parser failed", + "synchronous_standby_names"); return false; } diff --git a/src/backend/storage/buffer/localbuf.c b/src/backend/storage/buffer/localbuf.c index aebcf146b4..5b9cc850a2 100644 --- a/src/backend/storage/buffer/localbuf.c +++ b/src/backend/storage/buffer/localbuf.c @@ -705,7 +705,8 @@ check_temp_buffers(int *newval, void **extra, GucSource source) */ if (source != PGC_S_TEST && NLocBuffer && NLocBuffer != *newval) { - GUC_check_errdetail("temp_buffers cannot be changed after any temporary tables have been accessed in the session."); + GUC_check_errdetail("%s cannot be changed after any temporary tables have been accessed in the session.", + "temp_buffers"); return false; } return true; diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c index a185fb3d08..3b5d395a0f 100644 --- a/src/backend/storage/file/fd.c +++ b/src/backend/storage/file/fd.c @@ -3917,7 +3917,8 @@ check_debug_io_direct(char **newval, void **extra, GucSource source) #if PG_O_DIRECT == 0 if (strcmp(*newval, "") != 0) { - GUC_check_errdetail("debug_io_direct is not supported on this platform."); + GUC_check_errdetail("%s is not supported on this platform.", + "debug_io_direct"); result = false; } flags = 0; @@ -3964,14 +3965,16 @@ check_debug_io_direct(char **newval, void **extra, GucSource source) #if XLOG_BLCKSZ < PG_IO_ALIGN_SIZE if (result && (flags & (IO_DIRECT_WAL | IO_DIRECT_WAL_INIT))) { - GUC_check_errdetail("debug_io_direct is not supported for WAL because XLOG_BLCKSZ is too small"); + GUC_check_errdetail("%s is not supported for WAL because %s is too small", + "debug_io_direct", "XLOG_BLCKSZ"); result = false; } #endif #if BLCKSZ < PG_IO_ALIGN_SIZE if (result && (flags & IO_DIRECT_DATA)) { - GUC_check_errdetail("debug_io_direct is not supported for data because BLCKSZ is too small"); + GUC_check_errdetail("%s is not supported for data because %s is too small", + "debug_io_direct", "BLCKSZ"); result = false; } #endif diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c index 1129b8e4f2..b8d3df1a3b 100644 --- a/src/backend/storage/lmgr/predicate.c +++ b/src/backend/storage/lmgr/predicate.c @@ -1644,8 +1644,10 @@ GetSerializableTransactionSnapshot(Snapshot snapshot) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("cannot use serializable mode in a hot standby"), - errdetail("default_transaction_isolation is set to \"serializable\"."), - errhint("You can use \"SET default_transaction_isolation = 'repeatable read'\" to change the default."))); + errdetail("%s is set to \"%s\".", + "default_transaction_isolation", "serializable"), + errhint("You can use \"%s\" to change the default.", + "SET default_transaction_isolation = 'repeatable read'"))); /* * A special optimization is available for SERIALIZABLE READ ONLY diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 7298a187d1..9b55a584ed 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -3571,7 +3571,8 @@ check_max_stack_depth(int *newval, void **extra, GucSource source) if (stack_rlimit > 0 && newval_bytes > stack_rlimit - STACK_DEPTH_SLOP) { - GUC_check_errdetail("max_stack_depth must not exceed %ldkB.", + GUC_check_errdetail("%s must not exceed %ldkB.", + "max_stack_depth", (stack_rlimit - STACK_DEPTH_SLOP) / 1024L); GUC_check_errhint("Increase the platform's stack depth limit via \"ulimit -s\" or local equivalent."); return false; @@ -3596,7 +3597,8 @@ check_client_connection_check_interval(int *newval, void **extra, GucSource sour { if (!WaitEventSetCanReportClosed() && *newval != 0) { - GUC_check_errdetail("client_connection_check_interval must be set to 0 on this platform."); + GUC_check_errdetail("%s must be set to 0 on this platform.", + "client_connection_check_interval"); return false; } return true; @@ -3617,7 +3619,8 @@ check_stage_log_stats(bool *newval, void **extra, GucSource source) { if (*newval && log_statement_stats) { - GUC_check_errdetail("Cannot enable parameter when \"log_statement_stats\" is true."); + GUC_check_errdetail("Cannot enable parameter when %s is true.", + "log_statement_stats"); return false; } return true; @@ -3632,9 +3635,9 @@ check_log_stats(bool *newval, void **extra, GucSource source) if (*newval && (log_parser_stats || log_planner_stats || log_executor_stats)) { - GUC_check_errdetail("Cannot enable log_statement_stats when " - "log_parser_stats, log_planner_stats, " - "or log_executor_stats is true."); + GUC_check_errdetail("Cannot enable %s when %s, %s, or %s is true.", + "log_statement_stats", "log_parser_stats", + "log_planner_stats", "log_executor_stats"); return false; } return true; diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c index 56724ff815..60469e6258 100644 --- a/src/backend/utils/fmgr/dfmgr.c +++ b/src/backend/utils/fmgr/dfmgr.c @@ -358,8 +358,8 @@ incompatible_module_error(const char *libname, if (details.len) appendStringInfoChar(&details, '\n'); appendStringInfo(&details, - _("Server has FUNC_MAX_ARGS = %d, library has %d."), - magic_data.funcmaxargs, + _("Server has %s = %d, library has %d."), + "FUNC_MAX_ARGS", magic_data.funcmaxargs, module_magic_data->funcmaxargs); } if (module_magic_data->indexmaxkeys != magic_data.indexmaxkeys) @@ -367,8 +367,8 @@ incompatible_module_error(const char *libname, if (details.len) appendStringInfoChar(&details, '\n'); appendStringInfo(&details, - _("Server has INDEX_MAX_KEYS = %d, library has %d."), - magic_data.indexmaxkeys, + _("Server has %s = %d, library has %d."), + "INDEX_MAX_KEYS", magic_data.indexmaxkeys, module_magic_data->indexmaxkeys); } if (module_magic_data->namedatalen != magic_data.namedatalen) @@ -376,8 +376,8 @@ incompatible_module_error(const char *libname, if (details.len) appendStringInfoChar(&details, '\n'); appendStringInfo(&details, - _("Server has NAMEDATALEN = %d, library has %d."), - magic_data.namedatalen, + _("Server has %s = %d, library has %d."), + "NAMEDATALEN", magic_data.namedatalen, module_magic_data->namedatalen); } if (module_magic_data->float8byval != magic_data.float8byval) @@ -385,8 +385,8 @@ incompatible_module_error(const char *libname, if (details.len) appendStringInfoChar(&details, '\n'); appendStringInfo(&details, - _("Server has FLOAT8PASSBYVAL = %s, library has %s."), - magic_data.float8byval ? "true" : "false", + _("Server has %s = %s, library has %s."), + "FLOAT8PASSBYVAL", magic_data.float8byval ? "true" : "false", module_magic_data->float8byval ? "true" : "false"); } -- 2.39.2 ^ permalink raw reply [nested|flat] 21+ messages in thread
* Re: GUC names in messages @ 2023-12-08 14:48 Peter Eisentraut <[email protected]> parent: Peter Smith <[email protected]> 1 sibling, 1 reply; 21+ messages in thread From: Peter Eisentraut @ 2023-12-08 14:48 UTC (permalink / raw) To: Peter Smith <[email protected]>; +Cc: Michael Paquier <[email protected]>; Alvaro Herrera <[email protected]>; Nathan Bossart <[email protected]>; Laurenz Albe <[email protected]>; Tom Lane <[email protected]>; Daniel Gustafsson <[email protected]>; PostgreSQL Hackers <[email protected]> On 08.12.23 05:10, Peter Smith wrote: > Patch 0001 -- "datestyle" becomes DateStyle in messages > Rebased this again, which was part of an earlier patch set > - I think any GUC names documented as MixedCase should keep that same > case in messages; this also obeys the guidelines recently pushed [1]. > - Some others agreed, expecting the exact GUC name (in the message) > can be found in pg_settings [2]. > - OTOH, Michael didn't like the diff churn [3] caused by this patch. I'm fine with adjusting the mixed-case stuff, but intuitively, I don't think removing the quotes in this is an improvement: - GUC_check_errdetail("Conflicting \"datestyle\" specifications."); + GUC_check_errdetail("Conflicting DateStyle specifications."); ^ permalink raw reply [nested|flat] 21+ messages in thread
* Re: GUC names in messages @ 2023-12-10 23:07 Peter Smith <[email protected]> parent: Peter Eisentraut <[email protected]> 0 siblings, 1 reply; 21+ messages in thread From: Peter Smith @ 2023-12-10 23:07 UTC (permalink / raw) To: Peter Eisentraut <[email protected]>; +Cc: Michael Paquier <[email protected]>; Alvaro Herrera <[email protected]>; Nathan Bossart <[email protected]>; Laurenz Albe <[email protected]>; Tom Lane <[email protected]>; Daniel Gustafsson <[email protected]>; PostgreSQL Hackers <[email protected]> On Sat, Dec 9, 2023 at 1:48 AM Peter Eisentraut <[email protected]> wrote: > > On 08.12.23 05:10, Peter Smith wrote: > > Patch 0001 -- "datestyle" becomes DateStyle in messages > > Rebased this again, which was part of an earlier patch set > > - I think any GUC names documented as MixedCase should keep that same > > case in messages; this also obeys the guidelines recently pushed [1]. > > - Some others agreed, expecting the exact GUC name (in the message) > > can be found in pg_settings [2]. > > - OTOH, Michael didn't like the diff churn [3] caused by this patch. > > I'm fine with adjusting the mixed-case stuff, but intuitively, I don't > think removing the quotes in this is an improvement: > > - GUC_check_errdetail("Conflicting \"datestyle\" specifications."); > + GUC_check_errdetail("Conflicting DateStyle specifications."); > My original intention of this thread was only to document the GUC name quoting guidelines and then apply those consistently in the code. I'm happy either way for the MixedCase names to be quoted or not quoted, whatever is the consensus. If the rule is changed to quote those MixedCase GUCs then the docs will require minor tweaking CURRENT <para> In messages containing configuration variable names, do not include quotes when the names are visibly not natural English words, such as when they have underscores, are all-uppercase or have mixed case. Otherwise, quotes must be added. Do include quotes in a message where an arbitrary variable name is to be expanded. </para> "are all-uppercase or have mixed case." --> "or are all-uppercase." ====== Kind Regards, Peter Smith. Fujitsu Australia ^ permalink raw reply [nested|flat] 21+ messages in thread
* Re: GUC names in messages @ 2023-12-14 08:38 Peter Eisentraut <[email protected]> parent: Peter Smith <[email protected]> 0 siblings, 1 reply; 21+ messages in thread From: Peter Eisentraut @ 2023-12-14 08:38 UTC (permalink / raw) To: Peter Smith <[email protected]>; +Cc: Michael Paquier <[email protected]>; Alvaro Herrera <[email protected]>; Nathan Bossart <[email protected]>; Laurenz Albe <[email protected]>; Tom Lane <[email protected]>; Daniel Gustafsson <[email protected]>; PostgreSQL Hackers <[email protected]> On 11.12.23 00:07, Peter Smith wrote: > If the rule is changed to quote those MixedCase GUCs then the docs > will require minor tweaking > > CURRENT > <para> > In messages containing configuration variable names, do not include quotes > when the names are visibly not natural English words, such as when they > have underscores, are all-uppercase or have mixed case. Otherwise, quotes > must be added. Do include quotes in a message where an arbitrary variable > name is to be expanded. > </para> > > "are all-uppercase or have mixed case." --> "or are all-uppercase." After these discussions, I think this rule change was not a good idea. It effectively enforces these kinds of inconsistencies. For example, if you ever refactored "DateStyle is wrong" to "%s is wrong" you'd need to adjust the quotes, and thus user-visible behavior, for entirely internal reasons. This is not good. And then came the idea to determine the quoting dynamically, which I think everyone agreed was too much. So I don't see a way to make this work well. ^ permalink raw reply [nested|flat] 21+ messages in thread
* Re: GUC names in messages @ 2023-12-16 09:33 Michael Paquier <[email protected]> parent: Peter Eisentraut <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Michael Paquier @ 2023-12-16 09:33 UTC (permalink / raw) To: Peter Eisentraut <[email protected]>; +Cc: Peter Smith <[email protected]>; Alvaro Herrera <[email protected]>; Nathan Bossart <[email protected]>; Laurenz Albe <[email protected]>; Tom Lane <[email protected]>; Daniel Gustafsson <[email protected]>; PostgreSQL Hackers <[email protected]> On Thu, Dec 14, 2023 at 09:38:40AM +0100, Peter Eisentraut wrote: > After these discussions, I think this rule change was not a good idea. It > effectively enforces these kinds of inconsistencies. For example, if you > ever refactored > > "DateStyle is wrong" > > to > > "%s is wrong" > > you'd need to adjust the quotes, and thus user-visible behavior, for > entirely internal reasons. This is not good. So, what are you suggesting? Should the encouraged rule be removed from the docs? Or do you object to some of the changes done in the latest patch series v5? FWIW, I am a bit meh with v5-0001, because I don't see the benefits. On the contrary v5-0003 is useful, because it reduces a bit the number of strings to translate. That's always good to take. I don't have a problem with v5-0002, either, where we'd begin using the name of the GUC as stored in the static tables rather than the name provided in the SET query, particularly for the reason that it makes the GUC name a bit more consistent even when using double-quotes around the parameter name in the query, where the error messages would not force a lower-case conversion. The patch would, AFAIU, change HEAD from that: =# SET "intervalstylE" to popo; ERROR: 22023: invalid value for parameter "intervalstylE": "popo" To that: =# SET "intervalstylE" to popo; ERROR: 22023: invalid value for parameter "IntervalStyle": "popo" > And then came the idea to > determine the quoting dynamically, which I think everyone agreed was too > much. So I don't see a way to make this work well. Yeah, with the quotes being language-dependent, any idea I can think of is as good as unreliable and dead. -- Michael Attachments: [application/pgp-signature] signature.asc (833B, ../../[email protected]/2-signature.asc) download ^ permalink raw reply [nested|flat] 21+ messages in thread
end of thread, other threads:[~2023-12-16 09:33 UTC | newest] Thread overview: 21+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-05-15 05:51 [PATCH v5 4/8] Examples in the documentation now use EXEC David Fetter <[email protected]> 2023-11-08 22:53 Re: GUC names in messages Peter Smith <[email protected]> 2023-11-09 11:04 ` Re: GUC names in messages Alvaro Herrera <[email protected]> 2023-11-23 07:27 ` Re: GUC names in messages Peter Smith <[email protected]> 2023-11-24 03:11 ` Re: GUC names in messages Michael Paquier <[email protected]> 2023-11-24 09:53 ` Re: GUC names in messages Alvaro Herrera <[email protected]> 2023-11-24 14:01 ` Re: GUC names in messages Michael Paquier <[email protected]> 2023-11-26 22:41 ` Re: GUC names in messages Peter Smith <[email protected]> 2023-11-28 00:54 ` Re: GUC names in messages Peter Smith <[email protected]> 2023-11-30 05:59 ` Re: GUC names in messages Michael Paquier <[email protected]> 2023-11-30 06:29 ` Re: GUC names in messages Kyotaro Horiguchi <[email protected]> 2023-11-30 07:03 ` Re: GUC names in messages Michael Paquier <[email protected]> 2023-11-30 07:39 ` Re: GUC names in messages Peter Smith <[email protected]> 2023-11-30 10:57 ` Re: GUC names in messages Alvaro Herrera <[email protected]> 2023-11-30 20:38 ` Re: GUC names in messages Peter Eisentraut <[email protected]> 2023-12-08 04:10 ` Re: GUC names in messages Peter Smith <[email protected]> 2023-12-08 12:55 ` Re: GUC names in messages Alvaro Herrera <[email protected]> 2023-12-08 14:48 ` Re: GUC names in messages Peter Eisentraut <[email protected]> 2023-12-10 23:07 ` Re: GUC names in messages Peter Smith <[email protected]> 2023-12-14 08:38 ` Re: GUC names in messages Peter Eisentraut <[email protected]> 2023-12-16 09:33 ` Re: GUC names in messages Michael Paquier <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox