Timezone: resolve $TZDIR in runtime - Mailing list pgsql-general

From Anatolii Smolianinov
Subject Timezone: resolve $TZDIR in runtime
Date
Msg-id CABvPt_xtYyvFfyupGn=TXNGnEAFd0m_ARPFpDUWBcn603aM84w@mail.gmail.com
Whole thread Raw
Responses Re: Timezone: resolve $TZDIR in runtime
List pgsql-general
Hello,

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.

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.

Do you think it is a feasible thing to do? it would be very convenient for portable postgers builds.

Thanks!

pgsql-general by date:

Previous
From: user
Date:
Subject: Fwd: Postgres attach partition: AccessExclusive lock set on different tables depending on how attaching is performed
Next
From: "David G. Johnston"
Date:
Subject: Re: PostgreSQL Database Community Edition -- Please provide list of the supported hypervisors