Re: Is postgres ready for 2038?

From: Greg Stark <stark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>, 方徳輝 <javaeecoding(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Is postgres ready for 2038?
Date: 2020-11-19 05:28:27
Message-ID: CAM-w4HMzC1ETzXe=9AtFy6LGr7ZEHLABLTS=bC8Zubtu10EWpg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 18 Nov 2020 at 12:22, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> > On 11/18/20 9:44 AM, Tom Lane wrote:
> >> Hmm. Digging around, I see that Mkvcbuild.pm intentionally absorbs
> >> _USE_32BIT_TIME_T when building with a Perl that defines that.
> >> I don't know what the state of play is in terms of Windows Perl
> >> distributions getting off of that, but maybe we should press people
> >> to not be using such Perl builds.
>
> > I think there's a good argument to ban it if we're doing a 64 bit build
> > (and why would we do anything else?)
>
> I'm not really eager to ban it. If somebody is building with an old
> Perl distribution, and doesn't particularly care that the installation
> will break in 2038, why should we force them to care?

Wait, is configuring with a Perl that has 32-bit time_t driving the
rest of Postgres to use 32-bit timestamps? That seems like the tail
wagging the dog.

It seems like a sensible compromise would be to have Postgres's
configure default to 64-bit time_t and have a flag to choose 32-bit
time_t and then have a configure check that errors out if the time_t
in Perl doesn't match with a hint to either find a newer Perl
distribution or configure with the flag to choose 32-bit. Ie, don't
silently assume users want 32-bit time_t but leave them the option to
choose it explicitly.

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message torikoshia 2020-11-19 05:33:54 Re: [doc] plan invalidation when statistics are update
Previous Message Kyotaro Horiguchi 2020-11-19 05:25:36 Re: Protect syscache from bloating with negative cache entries