Re: Bug in date arithmetic

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

On Mon, Aug 24, 2009 at 02:31:35PM -0400, Tom Lane wrote:
> 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?),

Doesn't seem sensible to me, either.

> 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.

I'm thinking that the unknown literal here should just cause an error
in the case of '+'. Same with '-', for what it's worth.

Cheers,
David (There's something happening here. What is ain't exactly clear.)
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-08-24 19:27:54 Re: hba load error and silent mode
Previous Message Magnus Hagander 2009-08-24 19:23:30 Re: hba load error and silent mode