1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

In the continuing saga of FE/BE protocol revisions, add reporting of

initial values and runtime changes in selected parameters.  This gets
rid of the need for an initial 'select pg_client_encoding()' query in
libpq, bringing us back to one message transmitted in each direction
for a standard connection startup.  To allow server version to be sent
using the same GUC mechanism that handles other parameters, invent the
concept of a never-settable GUC parameter: you can 'show server_version'
but it's not settable by any GUC input source.  Create 'lc_collate' and
'lc_ctype' never-settable parameters so that people can find out these
settings without need for pg_controldata.  (These side ideas were all
discussed some time ago in pgsql-hackers, but not yet implemented.)
This commit is contained in:
Tom Lane
2003-04-25 19:45:10 +00:00
parent a2190c9eb6
commit 9cbaf72177
13 changed files with 412 additions and 478 deletions

View File

@ -1,4 +1,4 @@
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/protocol.sgml,v 1.30 2003/04/24 21:16:42 tgl Exp $ -->
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/protocol.sgml,v 1.31 2003/04/25 19:45:08 tgl Exp $ -->
<chapter id="protocol">
<title>Frontend/Backend Protocol</title>
@ -328,7 +328,7 @@
is being started, and the frontend is just an interested bystander.
It is still possible for the startup attempt
to fail (ErrorResponse), but in the normal case the backend will send
BackendKeyData, some ParameterStatus messages, and finally ReadyForQuery.
some ParameterStatus messages, BackendKeyData, and finally ReadyForQuery.
</para>
<para>
@ -900,9 +900,9 @@
<para>
At present there is a hard-wired set of parameters for which
ParameterStatus will be generated: they are
<literal>version</> (backend version,
a pseudo-parameter that cannot change after startup);
<literal>database_encoding</> (also not presently changeable after start);
<literal>server_version</> (a pseudo-parameter that cannot change after
startup);
<literal>server_encoding</> (also not presently changeable after start);
<literal>client_encoding</>, and
<literal>DateStyle</>.
This set might change in the future, or even become configurable.
@ -3881,6 +3881,13 @@ The CopyInResponse and CopyOutResponse messages carry a field indicating
whether the COPY operation is text or binary.
</para>
<para>
The backend sends ParameterStatus ('<literal>S</>') messages during connection
startup for all parameters it considers interesting to the client library.
Subsequently, a ParameterStatus message is sent whenever the active value
changes for any of these parameters.
</para>
<para>
The CursorResponse ('<literal>P</>') message is no longer generated by
the backend.

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.73 2003/03/25 16:15:44 petere Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.74 2003/04/25 19:45:08 tgl Exp $
PostgreSQL documentation
-->
@ -52,7 +52,7 @@ SET [ SESSION | LOCAL ] TIME ZONE { <replaceable class="PARAMETER">timezone</rep
<term><replaceable class="PARAMETER">variable</replaceable></term>
<listitem>
<para>
A settable run-time parameter.
Name of a settable run-time parameter.
</para>
</listitem>
</varlistentry>
@ -79,8 +79,9 @@ SET [ SESSION | LOCAL ] TIME ZONE { <replaceable class="PARAMETER">timezone</rep
<para>
The <command>SET</command> command changes run-time configuration
parameters. Many of the run-time parameters listed in the
<xref linkend="runtime-config"> can be changed on-the-fly with <command>SET</command>.
parameters. Many of the run-time parameters listed in
<xref linkend="runtime-config"> can be changed on-the-fly with
<command>SET</command>.
(But some require superuser privileges to change, and others cannot
be changed after server or session start.) Note that
<command>SET</command> only affects the value used by the current
@ -123,7 +124,7 @@ SET [ SESSION | LOCAL ] TIME ZONE { <replaceable class="PARAMETER">timezone</rep
<listitem>
<para>
Choose the date/time representation style. Two separate
settings are involved: the default date/time output and the
settings are involved: the default date/time output format and the
interpretation of ambiguous input.
</para>
@ -147,7 +148,7 @@ SET [ SESSION | LOCAL ] TIME ZONE { <replaceable class="PARAMETER">timezone</rep
<para>
Use Oracle/Ingres-style dates and times. Note that this
style has nothing to do with SQL (which mandates ISO 8601
style), the naming of this option is a historical accident.
style); the naming of this option is a historical accident.
</para>
</listitem>
</varlistentry>
@ -283,17 +284,6 @@ SELECT setseed(<replaceable>value</replaceable>);
</listitem>
</varlistentry>
<varlistentry>
<term>SERVER_ENCODING</term>
<listitem>
<para>
Shows the server-side multibyte encoding. (At present, this
parameter can be shown but not set, because the encoding is
determined at <application>initdb</> time.)
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>TIME ZONE</term>
<term>TIMEZONE</term>
@ -410,7 +400,7 @@ SELECT setseed(<replaceable>value</replaceable>);
</varlistentry>
<varlistentry>
<term><computeroutput>ERROR: '<replaceable>name</replaceable> is not a
<term><computeroutput>ERROR: '<replaceable>name</replaceable>' is not a
valid option name</computeroutput></term>
<listitem>
<para>
@ -447,7 +437,7 @@ SELECT setseed(<replaceable>value</replaceable>);
<title>Notes</title>
<para>
The function <function>set_config</function> provides the equivalent
The function <function>set_config</function> provides equivalent
capability. See <xref linkend="functions-misc">.
</para>
</refsect1>
@ -517,6 +507,8 @@ SELECT CURRENT_TIMESTAMP AS today;
<title>See Also</title>
<simpara>
<xref linkend="SQL-SHOW" endterm="SQL-SHOW-title">,
<xref linkend="SQL-RESET" endterm="SQL-RESET-title">,
<xref linkend="sql-set-constraints" endterm="sql-set-constraints-title">,
<xref linkend="sql-set-session-authorization" endterm="sql-set-session-authorization-title">,
<xref linkend="sql-set-transaction" endterm="sql-set-transaction-title">

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/show.sgml,v 1.24 2003/03/25 16:15:44 petere Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/show.sgml,v 1.25 2003/04/25 19:45:08 tgl Exp $
PostgreSQL documentation
-->
@ -52,12 +52,13 @@ SHOW ALL
<refsect1 id="R1-SQL-SHOW-1">
<title>Description</title>
<para>
<command>SHOW</command> will display the current setting of a
run-time parameter. These variables can be set using the
<command>SHOW</command> will display the current setting of
run-time parameters. These variables can be set using the
<command>SET</command> statement, by editing the
<filename>postgresql.conf</filename>, through the
<envar>PGOPTIONS</envar> environmental variable, or through a
command-line flag when starting the
<filename>postgresql.conf</filename> configuration file, through the
<envar>PGOPTIONS</envar> environmental variable (when using libpq
or a libpq-based application), or through
command-line flags when starting the
<application>postmaster</application>.
</para>
@ -66,6 +67,64 @@ SHOW ALL
does not start a new transaction block. See the
<varname>autocommit</> section in <xref linkend="runtime-config"> for details.
</para>
<para>
Available parameters are documented in
<xref linkend="runtime-config"> and on the
<xref linkend="SQL-SET" endterm="SQL-SET-title"> reference page.
In addition, there are a few parameters that can be shown but not set:
<variablelist>
<varlistentry>
<term>SERVER_VERSION</term>
<listitem>
<para>
Shows the server's version number.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>SERVER_ENCODING</term>
<listitem>
<para>
Shows the server-side multibyte encoding. At present, this
parameter can be shown but not set, because the encoding is
determined at database creation time.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>LC_COLLATE</term>
<listitem>
<para>
Shows the database's locale setting for collation (text ordering).
At present, this parameter can be shown but not set, because the
setting is determined at <application>initdb</> time.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>LC_CTYPE</term>
<listitem>
<para>
Shows the database's locale setting for character set considerations.
At present, this parameter can be shown but not set, because the
setting is determined at <application>initdb</> time.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
Use <xref linkend="SQL-SET" endterm="SQL-SET-title"> to set the value
of settable parameters.
</para>
</refsect1>
<refsect1>
@ -79,7 +138,7 @@ SHOW ALL
<listitem>
<para>
Message returned if <replaceable>name</replaceable> does
not stand for an existing parameter.
not stand for a known parameter.
</para>
</listitem>
</varlistentry>