From f01e3ba56fd125ccba65b23a1829fc25b6f3fc65 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Thu, 16 May 2024 09:15:01 +0900 Subject: [PATCH] doc: Mention more variant --name=value of -c name=value for postgres MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit postgres --name=value and -c name=value are equivalents. This commit expands the documentation of libpq's "option" connection parameter and the server startup sequence for shell interactions to mention both rather than only -c. Extracted from a larger patch by the same authors. Reported-by: Alexey Palazhchenko Author: David Johnston, Aleksander Alekseev Reviewed-by: Nathan Bossart, Peter Eisentraut, Álvaro Herrera Discussion: https://postgr.es/m/CAJ7c6TMkuLiLfrA+EFCPYfhXoMKRxxssB5c86+ibxfaz6+=Sdg@mail.gmail.com --- doc/src/sgml/config.sgml | 11 ++++++----- doc/src/sgml/libpq.sgml | 7 ++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index e93208b2e6..3777cfa52a 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -334,9 +334,10 @@ UPDATE pg_settings SET setting = reset_val WHERE name = 'configuration_parameter During server startup, parameter settings can be passed to the postgres command via the - command-line parameter. For example, + command-line parameter, or its equivalent + variation. For example, -postgres -c log_connections=yes -c log_destination='syslog' +postgres -c log_connections=yes --log-destination='syslog' Settings provided in this way override those set via postgresql.conf or ALTER SYSTEM, @@ -353,10 +354,10 @@ postgres -c log_connections=yes -c log_destination='syslog' of the session, but do not affect other sessions. For historical reasons, the format of PGOPTIONS is similar to that used when launching the postgres - command; specifically, the flag must be specified. - For example, + command; specifically, the , or prepended + --, before the name must be specified. For example, -env PGOPTIONS="-c geqo=off -c statement_timeout=5min" psql +env PGOPTIONS="-c geqo=off --statement-timeout=5min" psql diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 1d32c226d8..74b6ed0cf9 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -1421,9 +1421,10 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname Specifies command-line options to send to the server at connection - start. For example, setting this to -c geqo=off sets the - session's value of the geqo parameter to - off. Spaces within this string are considered to + start. For example, setting this to -c geqo=off + or --geqo=off sets the session's value of the + geqo parameter to off. + Spaces within this string are considered to separate command-line arguments, unless escaped with a backslash (\); write \\ to represent a literal backslash. For a detailed discussion of the available