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 17:54:15 |
Message-ID: | 20090824175415.GG5896@fetter.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, Aug 24, 2009 at 01:18:46PM -0400, Tom Lane wrote:
> I wrote:
> > ... I'm not sure why it's complaining about field overflow
> > rather than syntax error when the literal is taken as a timestamp,
> > but that's a pretty minor issue.
>
> Oh, of course, it's because we allow this shorthand:
>
> regression=# select '900102'::timestamptz;
> timestamptz
> ------------------------
> 1990-01-02 00:00:00-05
> (1 row)
>
> so '900000'::timestamptz is seen as year (19)90, month 00, day 00,
> and "field out of range" is entirely sensible for that.
>
> Just out of curiosity, what were you *expecting* this to do?
> You obviously weren't expecting the literal to be taken as
> interval, but its contents are not very sane for any other
> likely interpretation.
The gentleman in IRC was the one who was using the construct. I spell
out my date arithmetic. :)
Cheers,
David.
--
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
From | Date | Subject | |
---|---|---|---|
Next Message | Sam Mason | 2009-08-24 17:59:38 | Re: Slaying the HYPOTamus |
Previous Message | David Fetter | 2009-08-24 17:52:59 | Re: Slaying the HYPOTamus |