Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fGQrN-0004zA-Sh for pgsql-hackers@arkaria.postgresql.org; Wed, 09 May 2018 15:18:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fGQrM-0004kM-1M for pgsql-hackers@arkaria.postgresql.org; Wed, 09 May 2018 15:18:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fGQrL-0004kC-R2 for pgsql-hackers@lists.postgresql.org; Wed, 09 May 2018 15:18:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fGQrI-0005up-I1 for pgsql-hackers@postgresql.org; Wed, 09 May 2018 15:18:27 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w49FIAcj007192; Wed, 9 May 2018 11:18:10 -0400 From: Tom Lane To: Robert Haas cc: =?UTF-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= , John Naylor , Andres Freund , Andreas Karlsson , "pgsql-hackers@postgresql.org" Subject: Re: [HACKERS] Cutting initdb's runtime (Perl question embedded) In-reply-to: References: <30896.1492006367@sss.pgh.pa.us> <972d541d-7285-53ff-ea71-dcbfd886570a@proxel.se> <6312.1492100010@sss.pgh.pa.us> <20170417165315.7jtyajt7unjp56ii@alap3.anarazel.de> <7985.1492448973@sss.pgh.pa.us> <7408.1525812528@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Wed, 09 May 2018 11:09:02 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7190.1525879090.1@sss.pgh.pa.us> Date: Wed, 09 May 2018 11:18:10 -0400 Message-ID: <7191.1525879090@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Robert Haas writes: > On Tue, May 8, 2018 at 4:48 PM, Tom Lane wrote: >> Really the only thing here that jumps out as being unduly expensive for >> what it's doing is select_default_timezone. That is, and always has been, >> a brute-force algorithm; I wonder if there's a way to do better? > Who says we need a portable way? If we had something that worked on > Linux and macOS, it would cover most developer environments. I wonder > if readlink("/etc/localtime", buf, sz) might be a viable approach. I wondered about that, but I'm afraid it's often a hardlink not a symlink. Still, we could try it. > Also, how about having a --timezone option for initdb? We already have that, it's called the TZ environment variable. There was an effort awhile back to try to speed up the buildfarm by having that get set automatically, but it failed for reasons I don't recall ATM. regards, tom lane