Re: Inputting relative datetimes

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: Inputting relative datetimes
Дата
Msg-id CAEZATCXy=i464zhpdbR6nNFRPRU_ySyMog=vw=a2ibC0SHZmRw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Inputting relative datetimes  (Jeff MacDonald <jam@zoidtechnologies.com>)
Список pgsql-hackers
On 28 August 2011 00:00, Jeff MacDonald <jam@zoidtechnologies.com> wrote:
> Greetings,
>
> On Saturday, August 27, 2011 11:36:13 AM Dean Rasheed wrote:
>>
>> I'm not sure how best to handle timezones though, since it's
>> hard-coded list probably won't match the timezones PostgreSQL knows
>> about. Maybe that doesn't matter, I'm not sure.
>>
>
> It'll matter when the expression has a result that crosses the DST date. Does
> Postgres have a library that could be used by the parser?
>

On further examination of this and other datetime parsing code, I am
coming to the conclusion that for absolute timestamps the PostgreSQL
code is (IMO) the best and most flexible in terms of accepting a
variety of commons formats.

While getdate.y and others offer better support for relative
timestamps, it seems to come at the cost of poorer support for
absolute timestamps, which for me is a deal-breaker. There are also
other incompatibilities, such as different handling of "today", which
is just likely to lead to confusion.

It may not be worth the effort of trying to get a patch into core
PostgreSQL for this, but given the already excellent absolute
timestamp and interval support, I'm thinking that maybe the best
answer is to just write a userland function that breaks an input
string up into timestamp and interval parts and returns the resulting
timestamp.

Regards,
Dean


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Greg Smith
Дата:
Сообщение: Re: Displaying accumulated autovacuum cost
Следующее
От: Peter Eisentraut
Дата:
Сообщение: confusing invalid UTF8 byte sequence error