Re: Re: [BUGS][PATCH] BUG #14486: Inserting and selecting interval have different constraints

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vitaly Burovoy <vitaly(dot)burovoy(at)gmail(dot)com>
Cc: Pantelis Theodosiou <ypercube(at)gmail(dot)com>, web+postgresql(at)modin(dot)io, pgsql-bugs(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [BUGS][PATCH] BUG #14486: Inserting and selecting interval have different constraints
Date: 2017-01-05 21:39:34
Message-ID: 15458.1483652374@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Vitaly Burovoy <vitaly(dot)burovoy(at)gmail(dot)com> writes:
> On 1/5/17, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> My point is that ideally, any value that can physically fit into struct
>> Interval ought to be considered valid. The fact that interval_out can't
>> cope is a bug in interval_out, which ideally we would fix without
>> artificially restricting the range of the datatype.

> Am I correct that we are still limited by ECPG which is limited by the
> system "tm" struct?

I'm not really that concerned about whether ECPG can deal with enormous
intervals. If it bothers you, and you want to go fix it, more power to
you --- but I think fixing the backend is much higher priority.

> Also users who use a binary protocol can also use the "tm" struct and
> can not expect overflow.

If they store an enormous interval value, its really up to them not to
choke on it when they read it back. Not our problem.

> The docs say[1] the highest value of the interval type is 178_000_000
> years which is

... irrelevant really. That's talking about the largest possible value of
the "months" field, viz (2^31-1)/12. Perhaps we ought to document the
other field limits, but right now there's nothing there about how large
the hours field can get.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Vitaly Burovoy 2017-01-06 02:39:09 Re: Re: [BUGS][PATCH] BUG #14486: Inserting and selecting interval have different constraints
Previous Message Vitaly Burovoy 2017-01-05 19:46:28 Re: Re: [BUGS][PATCH] BUG #14486: Inserting and selecting interval have different constraints

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2017-01-05 21:42:58 Re: Supporting huge pages on Windows
Previous Message Tom Lane 2017-01-05 21:33:40 Re: [COMMITTERS] pgsql: Fix possible crash reading pg_stat_activity.