Re: Bug in date arithmetic

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Fetter <david(at)fetter(dot)org>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug in date arithmetic
Date: 2009-08-24 18:31:35
Message-ID: 29047.1251138695@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Fetter <david(at)fetter(dot)org> writes:
> He expected '-' to subtract seconds, just as '+' added them.

Ah. Well, what it boils down to is that in a scenario like

known_type_expr operator unknown_literal

we preferentially consider unknown_literal to be of the same type
as the other operand. But there's no timestamp plus timestamp
operator (doesn't seem like a sensible operation to me, does it
to you?), so there's only one possible typing of the unknown literal,
and it's not that. Plus and minus just aren't all that symmetrical
in this situation.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2009-08-24 18:37:33 Re: Slaying the HYPOTamus
Previous Message Tom Lane 2009-08-24 18:22:48 Re: hba load error and silent mode