pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Magnus Hagander <mha@sollentuna.net>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Cc: PostgreSQL-interfaces <pgsql-interfaces@postgresql.org>
Cc: PostgreSQL Win32 port list <pgsql-hackers-win32@postgresql.org>
Subject: Re: Timezone database questions
Date: Sun, 2 May 2004 14:16:40 -0400 (EDT)
Message-ID: <200405021816.i42IGeY14702@candle.pha.pa.us> (raw)
In-Reply-To: <6BCB9D8A16AC4241919521715F4D8BCE17166E@algol.sollentuna.se>

Magnus Hagander wrote:
> >> >1)  How do we set the default local timezone for our 
> >database?  The OS
> >> >knows the local timezone.  How do we set our local timezone 
> >on Win32? 
> >> >On Unix?  (On Unix, there is usually an /etc/localtime file that is
> >> >created during install.)  Perhaps we can query the current timezone
> >> >specification (e.g. EDT), and do some kind of lookup.  I 
> >know of no way
> >> >to get the full specification, e.g. EST5EDT or America/New_York.
> >> 
> >> Could we just require that it is configured through postgresql.conf?
> >> IIRC there is a parameter to set it there. IMO, that would be enough.
> >
> >We would get too many problem reports we would get if we always
> >defaulted the database timezone to GMT.  We have to set the default,
> >perhaps during initdb.  (I just posted something else explaining why we
> >should have initdb set sharedir and libdir too.)
> 
> Set the defualt timezone at initdb sounds a bit weird. Again, timezone
> stuff is only used to present data, not to change it. You can even
> change it during a transaction. Setting the default at inidb seems
> weird. If you want to set the default, use postgresql.conf. Otherwise,
> we need to pick it up somewhere else.

Yea, sorry, I meant to say we need to pick up the local timezone on
postmaster start.

> >> If not, we can use GetTimeZoneInformation(). It returns the standard
> >> name (amongst other things) of the tz configured in the system.
> >
> >Yep, we will need that, and for Unix too.
> 
> Can't tell you how to do it on Unix :-(
> 
> 
> >> Or do nothing. On unix it defaults to the value of the TZ environment
> >> variables. If you set that one before you start it, you get the same
> >> behaviour. In that case, I'd still say we *recommend* setting it in
> >> postgresql.conf, but it will still work.
> >
> >Right now I think it defaults to the OS timezone if you don't 
> >set PGTZ. 
> >We can't require everyone to set PGTZ to get a reasonable default
> >timezone.
> 
> Note - TZ, not PGTZ. At least it says so in the postgresql.conf that is
> installed. So it's at least a standard env variable, and not a PG only
> one. I don't know how often this one is actually set, though.

Yes, sorry, TZ.  It is not set on my box.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



view thread (5+ messages)

Message-ID: <200405021816.i42IGeY14702@candle.pha.pa.us>
Permalink:  ../200405021816.i42IGeY14702@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200405021816.i42IGeY14702@candle.pha.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: pgman@candle.pha.pa.us, mha@sollentuna.net, pgsql-hackers@postgresql.org, pgsql-hackers-win32@postgresql.org
  Subject: Re: Timezone database questions
  In-Reply-To: <200405021816.i42IGeY14702@candle.pha.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox