pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Vitaly Burovoy <vitaly.burovoy@gmail.com>
Cc: Pantelis Theodosiou <ypercube@gmail.com>
Cc: web+postgresql@modin.io
Cc: pgsql-bugs@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Re: [PATCH] BUG #14486: Inserting and selecting interval have different constraints
Date: Thu, 05 Jan 2017 11:48:27 -0500
Message-ID: <5118.1483634907@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKOSWNnhovGBeQfe9N-L09WW++zaZtg7p_2fq3MpTfUkqDinAA@mail.gmail.com>
References: <20170104150301.10134.9126@wrigleys.postgresql.org>
	<CAE3TBxzkGbTt7YEfZOJfCuOv21ZKaPZ2_=Nxe65m8Xc_oQn-rg@mail.gmail.com>
	<CAKOSWNmn9Kqq8wC0kjG6uh9jMV6WEAXtSVPd8pVCacTDg4yJ4A@mail.gmail.com>
	<CAKOSWNnhovGBeQfe9N-L09WW++zaZtg7p_2fq3MpTfUkqDinAA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Vitaly Burovoy <vitaly.burovoy@gmail.com> writes:
>> I've written a patch which fixes that bug (in attachment).
>> Should it be registered in the CF?

> Oops. Forgot to attach the patch. Fixed.

I suspect that many of these SAMESIGN() tests you've added are not
actually adequate/useful.  That's only sufficient when the output could be
at most a factor of 2 out-of-range.  If it could overflow past the sign
bit then you need to work harder.

(By the same token, the existing SAMESIGN test in interval2tm is
wrong.)

Possibly we should consider alternatives before plowing ahead in this
direction, since adding guards to interval_in and interval computations
doesn't help with oversize values that are already stored in a database.
We could think about replacing interval2tm's output format with some
other struct that uses a TimeOffset for hours and so cannot overflow.
I'm not sure though how far the effects would propagate; it might be
more work than we want to put into this.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (10+ messages)  latest in thread

Message-ID: <5118.1483634907@sss.pgh.pa.us>
Permalink:  ../5118.1483634907@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5118.1483634907@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, vitaly.burovoy@gmail.com, ypercube@gmail.com, web+postgresql@modin.io, pgsql-hackers@postgresql.org
  Subject: Re: [HACKERS] Re: [PATCH] BUG #14486: Inserting and selecting interval have different constraints
  In-Reply-To: <5118.1483634907@sss.pgh.pa.us>
  References: <20170104150301.10134.9126@wrigleys.postgresql.org> <CAE3TBxzkGbTt7YEfZOJfCuOv21ZKaPZ2_=Nxe65m8Xc_oQn-rg@mail.gmail.com> <CAKOSWNmn9Kqq8wC0kjG6uh9jMV6WEAXtSVPd8pVCacTDg4yJ4A@mail.gmail.com> <CAKOSWNnhovGBeQfe9N-L09WW++zaZtg7p_2fq3MpTfUkqDinAA@mail.gmail.com> <5118.1483634907@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox