Re: Integer overflow in timestamp_part()

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Vitaly Burovoy <vitaly(dot)burovoy(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Integer overflow in timestamp_part()
Date: 2016-02-03 01:34:25
Message-ID: 56B15921.8020005@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2/2/16 6:39 PM, Tom Lane wrote:
> I'm inclined to think that a good solution would be to create an
> artificial restriction to not accept years beyond, say, 100000 AD.
> That would leave us with a lot of daylight to not have to worry
> about corner-case overflows in timestamp arithmetic. I'm not sure
> though where we'd need to enforce such a restriction; certainly in
> timestamp[tz]_in, but where else?

Probably some of the casts (I'd think at least timestamp->timestamptz).
Maybe timestamp[tz]_recv. Most of the time*pl* functions. :/
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2016-02-03 01:48:36 Re: Support for N synchronous standby servers - take 2
Previous Message Curtis Ruck 2016-02-03 01:25:49 Re: PostgreSQL Auditing