Re: to_timestamp overloaded to convert from Unix epoch

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: to_timestamp overloaded to convert from Unix epoch
Дата
Msg-id 0B680D42-EDF5-11D8-831D-000A95C88220@myrealbox.com
обсуждение исходный текст
Ответ на Re: to_timestamp overloaded to convert from Unix epoch  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Ответы Re: to_timestamp overloaded to convert from Unix epoch  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
On Aug 14, 2004, at 6:50 PM, Christopher Kings-Lynne wrote:

> Maybe you don't need to override to_timestamp, and you can just add a
> new code to the format string that to_timestamp understands, ie 'e' or
> something or 'u' that means 'unix timestamp'?

Thanks for looking at the code! I know people are really busy now with
8.0.0beta1.

Are you thinking something like to_timestamp(200120400,'unix')? One
thing that I was thinking about when looking at the docs is that the
other to_ functions (other than to_char) took first a text-based
argument, and then the format. This to_timestamp takes (or casts to) a
double.

I can see how it might be forward-looking to have two parameters in
case we wanted to convert from some other numeric-based timestamp to
timestamptz; just change the formatting parameter. Two things come time
mind:

(1) I can't think of an instance when someone has asked to convert from
some other numeric-based timestamp.

(2) If the day comes when we would want to add another conversion,
nothing prevents us from creating it (though retaining the
one-parameter version for backwards-compatibility might be a reason
against this).

Thoughts?

Michael Glaesemann
grzm myrealbox com


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: [HACKERS] [Fwd: Re: [pgsql-hackers-win32] Import from Linux to
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: [HACKERS] [Fwd: Re: [pgsql-hackers-win32] Import from Linux to