Commit d16f8c8e authored by Tom Lane's avatar Tom Lane

Mark default_transaction_read_only as GUC_REPORT.

This allows clients to find out the setting at connection time without
having to expend a query round trip to do so; which is helpful when
trying to identify read/write servers.  (One must also look at
in_hot_standby, but that's already GUC_REPORT, cf bf8a662c.)
Modifying libpq to make use of this will come soon, but I felt it
cleaner to push the server change separately.

Haribabu Kommi, Greg Nancarrow, Vignesh C; reviewed at various times
by Laurenz Albe, Takayuki Tsunakawa, Peter Smith.

Discussion: https://postgr.es/m/CAF3+xM+8-ztOkaV9gHiJ3wfgENTq97QcjXQt+rbFQ6F7oNzt9A@mail.gmail.com
parent 75dbfe4c
......@@ -2191,6 +2191,7 @@ const char *PQparameterStatus(const PGconn *conn, const char *paramName);
<varname>server_encoding</varname>,
<varname>client_encoding</varname>,
<varname>application_name</varname>,
<varname>default_transaction_read_only</varname>,
<varname>in_hot_standby</varname>,
<varname>is_superuser</varname>,
<varname>session_authorization</varname>,
......@@ -2206,7 +2207,8 @@ const char *PQparameterStatus(const PGconn *conn, const char *paramName);
<varname>IntervalStyle</varname> was not reported by releases before 8.4;
<varname>application_name</varname> was not reported by releases before
9.0;
<varname>in_hot_standby</varname> was not reported by releases before
<varname>default_transaction_read_only</varname> and
<varname>in_hot_standby</varname> were not reported by releases before
14.)
Note that
<varname>server_version</varname>,
......
......@@ -1278,6 +1278,7 @@ SELCT 1/0;<!-- this typo is intentional -->
<varname>server_encoding</varname>,
<varname>client_encoding</varname>,
<varname>application_name</varname>,
<varname>default_transaction_read_only</varname>,
<varname>in_hot_standby</varname>,
<varname>is_superuser</varname>,
<varname>session_authorization</varname>,
......@@ -1293,7 +1294,8 @@ SELCT 1/0;<!-- this typo is intentional -->
<varname>IntervalStyle</varname> was not reported by releases before 8.4;
<varname>application_name</varname> was not reported by releases before
9.0;
<varname>in_hot_standby</varname> was not reported by releases before
<varname>default_transaction_read_only</varname> and
<varname>in_hot_standby</varname> were not reported by releases before
14.)
Note that
<varname>server_version</varname>,
......
......@@ -1619,7 +1619,8 @@ static struct config_bool ConfigureNamesBool[] =
{
{"default_transaction_read_only", PGC_USERSET, CLIENT_CONN_STATEMENT,
gettext_noop("Sets the default read-only status of new transactions."),
NULL
NULL,
GUC_REPORT
},
&DefaultXactReadOnly,
false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment