From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Davis <pgsql@j-davis.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: can insert timestamp value that can't be read
Date: Wed, 07 May 2014 01:00:46 -0400
Message-ID: <15053.1399438846@sss.pgh.pa.us> (raw)
In-Reply-To: <1399415471.27807.49.camel@sussancws0025>
References: <1399415471.27807.49.camel@sussancws0025>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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, pgsql@j-davis.com
Subject: Re: can insert timestamp value that can't be read
In-Reply-To: <15053.1399438846@sss.pgh.pa.us>
References: <1399415471.27807.49.camel@sussancws0025> <15053.1399438846@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