Mark server_encoding and integer_datetimes as GUC_REPORT, per previous
authorTom Lane
Mon, 16 Aug 2004 02:12:29 +0000 (02:12 +0000)
committerTom Lane
Mon, 16 Aug 2004 02:12:29 +0000 (02:12 +0000)
proposals by Oliver Jowett.  Update documentation.

doc/src/sgml/libpq.sgml
doc/src/sgml/protocol.sgml
doc/src/sgml/runtime.sgml
src/backend/utils/misc/guc.c

index 402f77bd7d41999194d821f5f27fedfb325f9328..af9a35a620da7d2b3c6e6cfc7ecfa6fdb3724d8f 100644 (file)
@@ -1,5 +1,5 @@
 
 
  
@@ -848,28 +848,45 @@ const char *PQparameterStatus(const PGconn *conn, const char *paramName);
 Certain parameter values are reported by the server automatically at
 connection startup or whenever their values change.
 PQparameterStatus can be used to interrogate these settings.
-It returns the current value of a parameter if known, or NULL if the parameter
-is not known.
+It returns the current value of a parameter if known, or NULL
+if the parameter is not known.
 
 
 
 Parameters reported as of the current release include
-server_version (cannot change after startup);
+server_version,
+server_encoding,
 client_encoding,
 is_superuser,
-session_authorization, and
-DateStyle.
+session_authorization,
+DateStyle, and
+integer_datetimes.
+(server_encoding and integer_datetimes were not
+reported by releases before 8.0.)
+Note that
+server_version,
+server_encoding and
+integer_datetimes
+cannot change after startup.
 
 
 
 Pre-3.0-protocol servers do not report parameter settings, but
 libpq includes logic to obtain values for
-server_version, and client_encoding.
+server_version and client_encoding anyway.
 Applications are encouraged to use PQparameterStatus
 rather than ad-hoc code to determine these values.  (Beware however
 that on a pre-3.0 connection, changing client_encoding via
 SET after connection startup will not be reflected by
-PQparameterStatus.)
+PQparameterStatus.)  For server_version,
+see also PQserverVersion, which returns the information
+in a numeric form that is much easier to compare against.
+
+
+
+Although the returned pointer is declared const, it in fact
+points to mutable storage associated with the PGconn structure.
+It is unwise to assume the pointer will remain valid across queries.
 
 
 
@@ -904,10 +921,10 @@ int PQserverVersion(const PGconn *conn);
 
 Applications may use this to determine the version of the database server they
 are connected to. The number is formed by converting the major, minor, and
-revision numbers into two digit numbers and appending them together. For
-example, version 7.4.2 will be returned as 70402, and version 8.1 will be
-returned as 80100 (leading zeroes are not shown).  Zero is returned if the
-connection is bad.
+revision numbers into two-decimal-digit numbers and appending them
+together. For example, version 7.4.2 will be returned as 70402, and version
+8.1 will be returned as 80100 (leading zeroes are not shown).  Zero is
+returned if the connection is bad.
 
 
 
index a88bca3002610283b43dd431dd425ff2b49df4b3..f2f0fddabf7c76f940c65f93abe372aad239be9f 100644 (file)
@@ -1,4 +1,4 @@
-
+
 
 
  Frontend/Backend Protocol
    
     At present there is a hard-wired set of parameters for which
     ParameterStatus will be generated: they are
-    server_version (a pseudo-parameter that cannot change after
-    startup);
+    server_version,
+    server_encoding,
     client_encoding,
     is_superuser,
-    session_authorization, and
-    DateStyle.
+    session_authorization,
+    DateStyle, and
+    integer_datetimes.
+    (server_encoding and integer_datetimes were not
+    reported by releases before 8.0.)
+    Note that
+    server_version,
+    server_encoding and
+    integer_datetimes
+    are pseudo-parameters that cannot change after startup.
     This set might change in the future, or even become configurable.
     Accordingly, a frontend should simply ignore ParameterStatus for
     parameters that it does not understand or care about.
index c1a3fa225bd92c9ca3432ab46e4a6c9df2d07c68..9cca707519ee3eee96b22f5392ab168b9bbb19c6 100644 (file)
@@ -1,5 +1,5 @@
 
 
 
@@ -2675,8 +2675,8 @@ archive_command = 'copy "%p" /mnt/server/archivedir/"%f"'  # Win32
 
      
 
-     datestyle">
-      datestyle (string)
+     DateStyle">
+      DateStyle (string)
       date style
       
        
@@ -3091,13 +3091,13 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
     
    
 
-   compiler">
-    <span class="marked">Compiled-in</span> Options
+   preset">
+    <span class="marked">Preset</span> Options
 
     
      The following parameters are read-only, and are determined
-     when PostgreSQL is compiled. As such,
-     they have been excluded from the sample
+     when PostgreSQL is compiled or when it is
+     installed. As such, they have been excluded from the sample
      postgresql.conf file.  These options determine
      various aspects of PostgreSQL behavior
      that may be of interest to certain applications, particularly
@@ -3125,7 +3125,7 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
       
        
         Shows whether PostgreSQL was built
-        with support for 64-bit integer dates and times.  It is set by
+        with support for 64-bit-integer dates and times.  It is set by
         configuring with --enable-integer-datetimes
         when building PostgreSQL.  The
         default value is off.
@@ -3133,6 +3133,30 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
       
      
 
+     
+      lc_collate (string)
+      
+       
+        Shows the locale in which sorting of textual data is done.
+   See  for more information.
+   The value is determined when the database cluster is initialized.
+       
+      
+     
+
+     
+      lc_ctype (string)
+      
+       
+        Shows the locale that determines character classifications.
+   See  for more information.
+   The value is determined when the database cluster is initialized.
+   Ordinarily this will be the same as lc_collate,
+   but for special applications it might be set differently.
+       
+      
+     
+
      
       max_function_args (integer)
       
@@ -3168,6 +3192,29 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
       
      
 
+     
+      server_encoding (string)
+      character set
+      
+       
+        Shows the database encoding (character set).
+        It is determined when the database is created.  Ordinarily,
+        clients need only be concerned with the value of 
+        linkend="guc-client-encoding">.
+       
+      
+     
+
+     
+      server_version (string)
+      
+       
+        Shows the version number of the server. It is determined by the
+        value of PG_VERSION when building the server.
+       
+      
+     
+
     
    
 
index d015629c3e790428836c3f3b68ddc67cd4cfd284..d0a12840bce18dd25ab2abd1d72bca75f58f315d 100644 (file)
@@ -10,7 +10,7 @@
  * Written by Peter Eisentraut .
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.231 2004/08/11 21:10:37 tgl Exp $
+ *   $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.232 2004/08/16 02:12:29 tgl Exp $
  *
  *--------------------------------------------------------------------
  */
@@ -828,7 +828,7 @@ static struct config_bool ConfigureNamesBool[] =
        {"integer_datetimes", PGC_INTERNAL, COMPILE_OPTIONS,
            gettext_noop("Datetimes are integer based"),
            NULL,
-           GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
+           GUC_REPORT | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
        },
        &integer_datetimes,
 #ifdef HAVE_INT64_TIMESTAMP
@@ -1624,7 +1624,7 @@ static struct config_string ConfigureNamesString[] =
        {"server_encoding", PGC_INTERNAL, CLIENT_CONN_LOCALE,
            gettext_noop("Sets the server (database) character set encoding."),
            NULL,
-           GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
+           GUC_REPORT | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
        },
        &server_encoding_string,
        "SQL_ASCII", NULL, NULL