diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-04-25 19:45:10 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-04-25 19:45:10 +0000 |
commit | 9cbaf7217747d6b5c88ba9b500a37b8372f185c9 (patch) | |
tree | 18569f5cba46f81d9097c9ea21c29f4a0e055936 /src/backend/utils/init/postinit.c | |
parent | a2190c9eb6afc65fddb80667d48024428368a9b6 (diff) | |
download | postgresql-9cbaf7217747d6b5c88ba9b500a37b8372f185c9.tar.gz postgresql-9cbaf7217747d6b5c88ba9b500a37b8372f185c9.zip |
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.)
Diffstat (limited to 'src/backend/utils/init/postinit.c')
-rw-r--r-- | src/backend/utils/init/postinit.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c index 36dd3c7b5c2..4d76e69ac99 100644 --- a/src/backend/utils/init/postinit.c +++ b/src/backend/utils/init/postinit.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.119 2003/02/19 14:31:26 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.120 2003/04/25 19:45:08 tgl Exp $ * * *------------------------------------------------------------------------- @@ -128,6 +128,9 @@ ReverifyMyDatabase(const char *name) * info out of the pg_database tuple. */ SetDatabaseEncoding(dbform->encoding); + /* Record it as a GUC internal option, too */ + SetConfigOption("server_encoding", GetDatabaseEncodingName(), + PGC_INTERNAL, PGC_S_OVERRIDE); /* If we have no other source of client_encoding, use server encoding */ SetConfigOption("client_encoding", GetDatabaseEncodingName(), PGC_BACKEND, PGC_S_DEFAULT); @@ -401,6 +404,12 @@ InitPostgres(const char *dbname, const char *username) InitializeClientEncoding(); /* + * Now all default states are fully set up. Report them to client + * if appropriate. + */ + BeginReportingGUCOptions(); + + /* * Set up process-exit callback to do pre-shutdown cleanup. This * should be last because we want shmem_exit to call this routine * before the exit callbacks that are registered by buffer manager, |