Skip site navigation (1) Skip section navigation (2)

Re: BUG #1993: Adding/subtracting negative time intervals

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: andrew(at)supernews(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1993: Adding/subtracting negative time intervals
Date: 2005-10-27 02:53:13
Message-ID: 200510270253.j9R2rDg07511@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
Andrew - Supernews wrote:
> On 2005-10-26, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > Andrew - Supernews <andrew+nonews(at)supernews(dot)com> writes:
> >> Um, what? Under what conditions is it permissable for simple arithmetic on
> >> (only) timestamptz values (which may have originated in different timezones
> >> neither of which is the current one) to be dependent on the current timezone
> >> setting?
> >
> > Timestamp subtraction will give different answers depending on whether
> > there's a DST adjustment in between.
> 
> no, it _WILL NOT_.
> 
> In your example, the result is different between timezones because the
> _input data_ is different. '2005-10-31'::timestamptz designates a different
> time in US/Eastern than it does in Japan, or UTC, or whatever.
> 
> Or to put it in terms of the code: in 8.0, timestamptz_in is stable
> rather than immutable (since it depends on timezone), while timestamptz_mi
> is immutable (result depends only on the input values).
> 
> In 8.0, I'm guaranteed that for timestamptz values, a+(b-a) = b in all
> cases regardless of timezone. 8.1 has broken that.

Yes, that is a valid problem, but what solution do we have at this
stage?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2005-10-27 03:02:47
Subject: Re: Call for port reports
Previous:From: Christopher Kings-LynneDate: 2005-10-27 01:49:48
Subject: Re: Differences in UTF8 between 8.0 and 8.1

pgsql-bugs by date

Next:From: manikandanDate: 2005-10-27 07:17:24
Subject: BUG #2002: shows version wronly
Previous:From: Andrew - SupernewsDate: 2005-10-26 19:10:43
Subject: Re: BUG #1993: Adding/subtracting negative time intervals

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group