Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite617fe7

Browse files
committed
Mark server_encoding and integer_datetimes as GUC_REPORT, per previous
proposals by Oliver Jowett. Update documentation.
1 parentc7ae53a commite617fe7

File tree

4 files changed

+100
-28
lines changed

4 files changed

+100
-28
lines changed

‎doc/src/sgml/libpq.sgml

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.158 2004/08/11 18:06:00 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.159 2004/08/16 02:12:29 tgl Exp $
33
-->
44

55
<chapter id="libpq">
@@ -848,28 +848,45 @@ const char *PQparameterStatus(const PGconn *conn, const char *paramName);
848848
Certain parameter values are reported by the server automatically at
849849
connection startup or whenever their values change.
850850
<function>PQparameterStatus</> can be used to interrogate these settings.
851-
It returns the current value of a parameter if known, or <symbol>NULL</symbol> if the parameter
852-
is not known.
851+
It returns the current value of a parameter if known, or <symbol>NULL</symbol>
852+
if the parameteris not known.
853853
</para>
854854

855855
<para>
856856
Parameters reported as of the current release include
857-
<literal>server_version</> (cannot change after startup);
857+
<literal>server_version</>,
858+
<literal>server_encoding</>,
858859
<literal>client_encoding</>,
859860
<literal>is_superuser</>,
860-
<literal>session_authorization</literal>, and
861-
<literal>DateStyle</>.
861+
<literal>session_authorization</>,
862+
<literal>DateStyle</>, and
863+
<literal>integer_datetimes</>.
864+
(<literal>server_encoding</> and <literal>integer_datetimes</> were not
865+
reported by releases before 8.0.)
866+
Note that
867+
<literal>server_version</>,
868+
<literal>server_encoding</> and
869+
<literal>integer_datetimes</>
870+
cannot change after startup.
862871
</para>
863872

864873
<para>
865874
Pre-3.0-protocol servers do not report parameter settings, but
866875
<application>libpq</> includes logic to obtain values for
867-
<literal>server_version</>, and <literal>client_encoding</>.
876+
<literal>server_version</> and <literal>client_encoding</> anyway.
868877
Applications are encouraged to use <function>PQparameterStatus</>
869878
rather than ad-hoc code to determine these values. (Beware however
870879
that on a pre-3.0 connection, changing <literal>client_encoding</> via
871880
<command>SET</> after connection startup will not be reflected by
872-
<function>PQparameterStatus</>.)
881+
<function>PQparameterStatus</>.) For <literal>server_version</>,
882+
see also <function>PQserverVersion</>, which returns the information
883+
in a numeric form that is much easier to compare against.
884+
</para>
885+
886+
<para>
887+
Although the returned pointer is declared <literal>const</>, it in fact
888+
points to mutable storage associated with the <literal>PGconn</> structure.
889+
It is unwise to assume the pointer will remain valid across queries.
873890
</para>
874891
</listitem>
875892
</varlistentry>
@@ -904,10 +921,10 @@ int PQserverVersion(const PGconn *conn);
904921
</synopsis>
905922
Applications may use this to determine the version of the database server they
906923
are connected to. The number is formed by converting the major, minor, and
907-
revision numbers into twodigit numbers and appending them together. For
908-
example, version 7.4.2 will be returned as 70402, and version 8.1 will be
909-
returned as 80100 (leading zeroes are not shown). Zero is returned if the
910-
connection is bad.
924+
revision numbers into two-decimal-digit numbers and appending them
925+
together. Forexample, version 7.4.2 will be returned as 70402, and version
926+
8.1 will bereturned as 80100 (leading zeroes are not shown). Zero is
927+
returned if theconnection is bad.
911928
</para>
912929
</listitem>
913930
</varlistentry>

‎doc/src/sgml/protocol.sgml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/protocol.sgml,v 1.52 2004/06/11 01:08:33 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/protocol.sgml,v 1.53 2004/08/16 02:12:29 tgl Exp $ -->
22

33
<chapter id="protocol">
44
<title>Frontend/Backend Protocol</title>
@@ -1046,12 +1046,20 @@
10461046
<para>
10471047
At present there is a hard-wired set of parameters for which
10481048
ParameterStatus will be generated: they are
1049-
<literal>server_version</> (a pseudo-parameter that cannot change after
1050-
startup);
1049+
<literal>server_version</>,
1050+
<literal>server_encoding</>,
10511051
<literal>client_encoding</>,
10521052
<literal>is_superuser</>,
1053-
<literal>session_authorization</literal>, and
1054-
<literal>DateStyle</>.
1053+
<literal>session_authorization</>,
1054+
<literal>DateStyle</>, and
1055+
<literal>integer_datetimes</>.
1056+
(<literal>server_encoding</> and <literal>integer_datetimes</> were not
1057+
reported by releases before 8.0.)
1058+
Note that
1059+
<literal>server_version</>,
1060+
<literal>server_encoding</> and
1061+
<literal>integer_datetimes</>
1062+
are pseudo-parameters that cannot change after startup.
10551063
This set might change in the future, or even become configurable.
10561064
Accordingly, a frontend should simply ignore ParameterStatus for
10571065
parameters that it does not understand or care about.

‎doc/src/sgml/runtime.sgml

Lines changed: 55 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.277 2004/08/13 16:29:55 momjian Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.278 2004/08/16 02:12:29 tgl Exp $
33
-->
44

55
<Chapter Id="runtime">
@@ -2675,8 +2675,8 @@ archive_command = 'copy "%p" /mnt/server/archivedir/"%f"' # Win32
26752675

26762676
<variablelist>
26772677

2678-
<varlistentry id="guc-datestyle" xreflabel="datestyle">
2679-
<term><varname>datestyle</varname> (<type>string</type>)</term>
2678+
<varlistentry id="guc-datestyle" xreflabel="DateStyle">
2679+
<term><varname>DateStyle</varname> (<type>string</type>)</term>
26802680
<indexterm><primary>date style</></>
26812681
<listitem>
26822682
<para>
@@ -3091,13 +3091,13 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
30913091
</sect3>
30923092
</sect2>
30933093

3094-
<sect2 id="runtime-config-compiler">
3095-
<title>Compiled-in Options</title>
3094+
<sect2 id="runtime-config-preset">
3095+
<title>Preset Options</title>
30963096

30973097
<para>
30983098
The following <quote>parameters</> are read-only, and are determined
3099-
when <productname>PostgreSQL</productname> is compiled. As such,
3100-
they have been excluded from the sample
3099+
when <productname>PostgreSQL</productname> is compiled or when it is
3100+
installed. As such,they have been excluded from the sample
31013101
<filename>postgresql.conf</> file. These options determine
31023102
various aspects of <productname>PostgreSQL</productname> behavior
31033103
that may be of interest to certain applications, particularly
@@ -3125,14 +3125,38 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
31253125
<listitem>
31263126
<para>
31273127
Shows whether <productname>PostgreSQL</productname> was built
3128-
with support for 64-bitinteger dates and times. It is set by
3128+
with support for 64-bit-integer dates and times. It is set by
31293129
configuring with <literal>--enable-integer-datetimes</literal>
31303130
when building <productname>PostgreSQL</productname>. The
31313131
default value is <literal>off</literal>.
31323132
</para>
31333133
</listitem>
31343134
</varlistentry>
31353135

3136+
<varlistentry id="guc-lc-collate" xreflabel="lc_collate">
3137+
<term><varname>lc_collate</varname> (<type>string</type>)</term>
3138+
<listitem>
3139+
<para>
3140+
Shows the locale in which sorting of textual data is done.
3141+
See <xref linkend="locale"> for more information.
3142+
The value is determined when the database cluster is initialized.
3143+
</para>
3144+
</listitem>
3145+
</varlistentry>
3146+
3147+
<varlistentry id="guc-lc-ctype" xreflabel="lc_ctype">
3148+
<term><varname>lc_ctype</varname> (<type>string</type>)</term>
3149+
<listitem>
3150+
<para>
3151+
Shows the locale that determines character classifications.
3152+
See <xref linkend="locale"> for more information.
3153+
The value is determined when the database cluster is initialized.
3154+
Ordinarily this will be the same as <varname>lc_collate</varname>,
3155+
but for special applications it might be set differently.
3156+
</para>
3157+
</listitem>
3158+
</varlistentry>
3159+
31363160
<varlistentry id="guc-max-function-args" xreflabel="max_function_args">
31373161
<term><varname>max_function_args</varname> (<type>integer</type>)</term>
31383162
<listitem>
@@ -3168,6 +3192,29 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
31683192
</listitem>
31693193
</varlistentry>
31703194

3195+
<varlistentry id="guc-server-encoding" xreflabel="server_encoding">
3196+
<term><varname>server_encoding</varname> (<type>string</type>)</term>
3197+
<indexterm><primary>character set</></>
3198+
<listitem>
3199+
<para>
3200+
Shows the database encoding (character set).
3201+
It is determined when the database is created. Ordinarily,
3202+
clients need only be concerned with the value of <xref
3203+
linkend="guc-client-encoding">.
3204+
</para>
3205+
</listitem>
3206+
</varlistentry>
3207+
3208+
<varlistentry id="guc-server-version" xreflabel="server_version">
3209+
<term><varname>server_version</varname> (<type>string</type>)</term>
3210+
<listitem>
3211+
<para>
3212+
Shows the version number of the server. It is determined by the
3213+
value of <literal>PG_VERSION</> when building the server.
3214+
</para>
3215+
</listitem>
3216+
</varlistentry>
3217+
31713218
</variablelist>
31723219
</sect2>
31733220

‎src/backend/utils/misc/guc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.231 2004/08/11 21:10:37 tgl Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.232 2004/08/16 02:12:29 tgl Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -828,7 +828,7 @@ static struct config_bool ConfigureNamesBool[] =
828828
{"integer_datetimes",PGC_INTERNAL,COMPILE_OPTIONS,
829829
gettext_noop("Datetimes are integer based"),
830830
NULL,
831-
GUC_NOT_IN_SAMPLE |GUC_DISALLOW_IN_FILE
831+
GUC_REPORT |GUC_NOT_IN_SAMPLE |GUC_DISALLOW_IN_FILE
832832
},
833833
&integer_datetimes,
834834
#ifdefHAVE_INT64_TIMESTAMP
@@ -1624,7 +1624,7 @@ static struct config_string ConfigureNamesString[] =
16241624
{"server_encoding",PGC_INTERNAL,CLIENT_CONN_LOCALE,
16251625
gettext_noop("Sets the server (database) character set encoding."),
16261626
NULL,
1627-
GUC_NOT_IN_SAMPLE |GUC_DISALLOW_IN_FILE
1627+
GUC_REPORT |GUC_NOT_IN_SAMPLE |GUC_DISALLOW_IN_FILE
16281628
},
16291629
&server_encoding_string,
16301630
"SQL_ASCII",NULL,NULL

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp