pgsql: Simplify handling of the timezone GUC by making initdb choose th

Started by Tom Laneover 14 years ago3 messageshackers
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Simplify handling of the timezone GUC by making initdb choose the default.

We were doing some amazingly complicated things in order to avoid running
the very expensive identify_system_timezone() procedure during GUC
initialization. But there is an obvious fix for that, which is to do it
once during initdb and have initdb install the system-specific default into
postgresql.conf, as it already does for most other GUC variables that need
system-environment-dependent defaults. This means that the timezone (and
log_timezone) settings no longer have any magic behavior in the server.
Per discussion.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/ca4af308c32d03db5fbacb54d6e583ceb904f268

Modified Files
--------------
doc/src/sgml/config.sgml | 14 +-
doc/src/sgml/datatype.sgml | 21 +-
doc/src/sgml/ref/set.sgml | 4 +-
src/backend/bootstrap/bootstrap.c | 4 -
src/backend/commands/variable.c | 43 +-
src/backend/postmaster/postmaster.c | 15 -
src/backend/tcop/postgres.c | 4 -
src/backend/utils/error/elog.c | 29 +-
src/backend/utils/misc/guc-file.l | 1 -
src/backend/utils/misc/guc.c | 21 +-
src/backend/utils/misc/postgresql.conf.sample | 4 +-
src/bin/initdb/.gitignore | 1 +
src/bin/initdb/Makefile | 11 +-
src/bin/initdb/findtimezone.c | 1224 ++++++++++++++++++++++++
src/bin/initdb/initdb.c | 25 +-
src/include/pgtime.h | 23 +-
src/include/utils/guc.h | 2 -
src/timezone/localtime.c | 28 +
src/timezone/pgtz.c | 1265 +------------------------
19 files changed, 1372 insertions(+), 1367 deletions(-)

#2Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Tom Lane (#1)
nonempty default log_line_prefix (was [COMMITTERS] pgsql: Simplify handling of the timezone GUC)

Excerpts from Tom Lane's message of vie sep 09 18:59:45 -0300 2011:

Simplify handling of the timezone GUC by making initdb choose the default.

We were doing some amazingly complicated things in order to avoid running
the very expensive identify_system_timezone() procedure during GUC
initialization. But there is an obvious fix for that, which is to do it
once during initdb and have initdb install the system-specific default into
postgresql.conf, as it already does for most other GUC variables that need
system-environment-dependent defaults. This means that the timezone (and
log_timezone) settings no longer have any magic behavior in the server.
Per discussion.

Hmm, I was hoping that this might open the door for setting a nonempty
default log_line_prefix, but apparently not :-( Seems
setup_formatted_start_time is still expecting that GUC initialization
would be called before we do anything with it. Pity ...

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#2)
Re: nonempty default log_line_prefix (was [COMMITTERS] pgsql: Simplify handling of the timezone GUC)

Alvaro Herrera <alvherre@commandprompt.com> writes:

Excerpts from Tom Lane's message of vie sep 09 18:59:45 -0300 2011:

Simplify handling of the timezone GUC by making initdb choose the default.

Hmm, I was hoping that this might open the door for setting a nonempty
default log_line_prefix, but apparently not :-( Seems
setup_formatted_start_time is still expecting that GUC initialization
would be called before we do anything with it. Pity ...

I think it actually would work now, you'd just have to accept that any
log messages that come out during GUC initialization might appear in GMT.
I didn't really experiment with that angle of it --- feel free.

But having said that, I'm not sure that there's a consensus for changing
the default log_line_prefix.

regards, tom lane