pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Cc: adrian.klaver@aklaver.com
Cc: frazer@frazermclean.co.uk
Cc: pgsql-general@postgresql.org
Subject: Re: Unexpected interval comparison
Date: Mon, 03 Apr 2017 11:35:25 -0400
Message-ID: <23053.1491233725@sss.pgh.pa.us> (raw)
In-Reply-To: <20170403.205118.123793330.horiguchi.kyotaro@lab.ntt.co.jp>
References: <2087.1490885839@sss.pgh.pa.us>
	<20170331.142157.204383147.horiguchi.kyotaro@lab.ntt.co.jp>
	<10353.1490981364@sss.pgh.pa.us>
	<20170403.205118.123793330.horiguchi.kyotaro@lab.ntt.co.jp>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>

Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> writes:
> Ok, the attached patch changes the result type of
> interval_cmp_value from TimeOffset(=int64) to new 128 bit
> LinearInterval. The value is hidden under the functions
> interval_eq/ge.../cmp and all other stuff seems to use the
> functions.

Looking at this now ... why isn't the INT64_AU32 macro just

#define INT64_AU32(i64) ((i64) >> 32)

?  The business with subtracting and re-adding 1 seems unnecessary, and it
also creates a risk of overflow with the minimum possible int64 value.

			regards, tom lane


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



view thread (17+ messages)  latest in thread

Message-ID: <23053.1491233725@sss.pgh.pa.us>
Permalink:  ../23053.1491233725@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23053.1491233725@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 using the --to and --cc options:
  reply via email

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, horiguchi.kyotaro@lab.ntt.co.jp, adrian.klaver@aklaver.com, frazer@frazermclean.co.uk
  Subject: Re: Unexpected interval comparison
  In-Reply-To: <23053.1491233725@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