Re: Inputting relative datetimes - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Inputting relative datetimes
Date
Msg-id CA+Tgmoa0BRHMUY=mb8etWhi3G9ZAHk1v-0jhAmk70f0_FWfxag@mail.gmail.com
Whole thread Raw
In response to Re: Inputting relative datetimes  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Responses Re: Inputting relative datetimes
List pgsql-hackers
On Sat, Aug 27, 2011 at 7:43 AM, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
> On 27 August 2011 12:29, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
>> ... if nothing else it has been a
>> fun exercise figuring out how the datetime string parsing code works.
>
> While looking through the current code, I spotted the following oddity:
>
> select timestamp 'yesterday 10:30';
>      timestamp
> ---------------------
>  2011-08-26 10:30:00
>
> which is what you'd expect, however:
>
> select timestamp '10:30 yesterday';
>      timestamp
> ---------------------
>  2011-08-26 00:00:00
>
> Similarly "today" and "tomorrow" reset any time fields so far, but
> ISTM that they should really be preserving the hour, min, sec fields
> decoded so far.

Sounds right to me.  Want to send a patch?

BTW, this is exactly the sort of thing that makes me a bit skeptical
about further extending this...

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Daniel Farina
Date:
Subject: Re: Cryptic error message in low-memory conditions
Next
From: Robert Haas
Date:
Subject: spinlocks on HP-UX