Robert Haas <robertmh...@gmail.com> writes: > On Tue, May 8, 2018 at 4:48 PM, Tom Lane <t...@sss.pgh.pa.us> 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