Re: Unexpected interval comparison - Mailing list pgsql-general

From Tom Lane
Subject Re: Unexpected interval comparison
Date
Msg-id 23053.1491233725@sss.pgh.pa.us
Whole thread Raw
In response to Re: Unexpected interval comparison  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Responses Re: Unexpected interval comparison  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
List pgsql-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


pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: My humble tribute to psql -- usql v0.5.0
Next
From: Joe Conway
Date:
Subject: Re: PostgreSQL and Kubernetes