Re: can insert timestamp value that can't be read - Mailing list pgsql-bugs

From Tom Lane
Subject Re: can insert timestamp value that can't be read
Date
Msg-id 15053.1399438846@sss.pgh.pa.us
Whole thread Raw
In response to can insert timestamp value that can't be read  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: can insert timestamp value that can't be read  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-bugs
Jeff Davis <pgsql@j-davis.com> writes:
> It looks like timestamp[tz]_pl_interval() is not doing proper validation
> in all paths.

> Patch attached. I looked for other areas that might be affected, but
> none jumped out.

This seems to be adding a heck of a lot of cycles (viz, replacing a
simple int64 or float8 addition with timestamp2tm then tm2timestamp)
to fix a corner case that will probably not matter to anyone anytime
in the next 200 thousand years, give or take a few millenia.  I'm okay
with the concept of detecting overflow here, but not at this price.
Can't we do a more direct overflow check, comparable to what ordinary
int64/float8 addition does?

Also, surely timestamp_mi_interval has got the identical issue, and
probably some other operators.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Jamie Koceniak
Date:
Subject: Re: BUG #9635: Wal sender process is using 100% CPU
Next
From: Rainer Tammer
Date:
Subject: Re: Problem with PostgreSQL 9.2.7 and make check on AIX 7.1