Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t2tXc-008GrX-U9 for pgsql-general@arkaria.postgresql.org; Mon, 21 Oct 2024 14:37:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t2tXb-00897g-5I for pgsql-general@arkaria.postgresql.org; Mon, 21 Oct 2024 14:37:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t2tXa-00897X-R0 for pgsql-general@lists.postgresql.org; Mon, 21 Oct 2024 14:37:51 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t2tXY-0021Ei-Hl for pgsql-general@lists.postgresql.org; Mon, 21 Oct 2024 14:37:49 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 49LEblFc1554257; Mon, 21 Oct 2024 10:37:47 -0400 From: Tom Lane To: zarkonesmall@gmail.com cc: pgsql-general@lists.postgresql.org Subject: Re: Timezone: resolve $TZDIR in runtime In-reply-to: References: Comments: In-reply-to Anatolii Smolianinov message dated "Mon, 21 Oct 2024 12:01:19 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1554255.1729521467.1@sss.pgh.pa.us> Date: Mon, 21 Oct 2024 10:37:47 -0400 Message-ID: <1554256.1729521467@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Anatolii Smolianinov 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