public inbox for [email protected]
help / color / mirror / Atom feedFrom: Anatolii Smolianinov <[email protected]>
To: Tom Lane <[email protected]>
Cc: [email protected]
Subject: Re: Timezone: resolve $TZDIR in runtime
Date: Mon, 21 Oct 2024 17:03:14 +0200
Message-ID: <CABvPt_zjW7oVeYg9SMtYre0cG_Jm_mxPiErZMvf2Eco-hOcDxA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CABvPt_xtYyvFfyupGn=TXNGnEAFd0m_ARPFpDUWBcn603aM84w@mail.gmail.com>
<[email protected]>
Hi Tom, thanks for your reply!
I understand your point, and also, the idea of embedding postgresql -- it
might be just not what postgresql is built for. I was just thinking that
respecting the standard TZDIR approach would add more flexibility.
If you have 5 linux distros and everyone has a different tzdata location,
it doesn't make much sense to rebuild binaries for each of these distros.
Which means, compile time config is actually the part which adds complexity
-- at least for packaging.
There is no point in having $TZDIR if it's not respected by software. Also,
it feels that setting the filesystem path in compile time just doesn't make
much sense -- it should be a part of runtime configuration.
In my case though, it doesn't block me or anything, -- as you've mentioned,
I can just rebuild without this flag. I was just thinking that supporting
the standard way of timezone configuration would improve the experience of
using postgresql in general and make it more predictive. Maybe it's not
true though due to legacy reasons though -- old users just wouldn't expect
$TZDIR to alter the configuration.
On Mon, Oct 21, 2024 at 4:37 PM Tom Lane <[email protected]> wrote:
> Anatolii Smolianinov <[email protected]> writes:
> > I was recently working with a project which embeds postgres into
> > application. It uses binaries built for Debian, and configured to look
> for
> > timezones in Debian's timezone folder /usr/share/zoneinfo/, which wasn't
> > present on my system.
>
> Why are you trying to use binaries built for Debian on some other
> platform? Seems like there'd be more problems than just timezones.
>
> > I was thinking if it's possible to redefine it in runtime, and found that
> > it is not possible: postgres support either compilation flag
> > --with-system-tzdata or built-in tz file -- timezone/data/tzdata.zi.
> From
> > the other hand, looking at src/timezone/pgtz.c#L54, it seems that
> timezone
> > dir resolve happens in runtime, which means, it is possible to use $TZDIR
> > environment variable or configuration option to achieve this without
> > recompilation.
>
> I'm pretty down on this idea because it adds complexity, ie ways to
> break things. If you want a more self-contained installation, you
> could build it without specifying --with-system-tzdata.
>
> regards, tom lane
>
view thread (8+ messages) latest in thread
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: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Timezone: resolve $TZDIR in runtime
In-Reply-To: <CABvPt_zjW7oVeYg9SMtYre0cG_Jm_mxPiErZMvf2Eco-hOcDxA@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox