Re: INTERVAL overflow detection is terribly broken

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Florian Pflug <fgp(at)phlo(dot)org>, Rok Kralj <rok(dot)kralj(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: INTERVAL overflow detection is terribly broken
Date: 2014-01-28 00:19:21
Message-ID: 26785.1390868361@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> Oh, one odd thing about this patch. I found I needed to use INT64_MAX,
> but I don't see it used anywhere else in our codebase. Is this OK? Is
> there a better way?

Most of the overflow tests in int.c and int8.c are coded to avoid relying
on the MIN or MAX constants; which seemed like better style at the time.
I'm not sure whether relying on INT64_MAX to exist is portable.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message KONDO Mitsumasa 2014-01-28 01:12:34 Re: pgsql: Keep pg_stat_statements' query texts in a file, not in shared me
Previous Message Kouhei Kaigai 2014-01-28 00:14:06 Re: Custom Scan APIs (Re: Custom Plan node)