Re: to_timestamp overloaded to convert from Unix epoch

Поиск
Список
Период
Сортировка
Искать
От
Christopher Kings-Lynne
Тема
Re: to_timestamp overloaded to convert from Unix epoch
Дата
Msg-id
411DE079.1070207@familyhealth.com.au
Ответ на
Список
Дерево обсуждения
to_timestamp overloaded to convert from Unix epoch Michael Glaesemann <grzm@myrealbox.com>
Re: to_timestamp overloaded to convert from Unix epoch Bruce Momjian <pgman@candle.pha.pa.us>
Re: to_timestamp overloaded to convert from Unix epoch Bruce Momjian <pgman@candle.pha.pa.us>
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 Michael Glaesemann <grzm@myrealbox.com>
Re: to_timestamp overloaded to convert from Unix epoch Tom Lane <tgl@sss.pgh.pa.us>
Re: to_timestamp overloaded to convert from Unix epoch Michael Glaesemann <grzm@myrealbox.com>
Re: to_timestamp overloaded to convert from Unix epoch Tom Lane <tgl@sss.pgh.pa.us>
Re: to_timestamp overloaded to convert from Unix epoch Bruce Momjian <pgman@candle.pha.pa.us>
Re: to_timestamp overloaded to convert from Unix epoch Bruce Momjian <pgman@candle.pha.pa.us>
I wonder...

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'?

Chris

Michael Glaesemann wrote:

> Please find attached a patch (diff -c against cvs HEAD) to add a 
> function that accepts a double precision argument assumed to be a Unix 
> epoch timestamp and returns timestamp with time zone, and accompanying 
> documentation.
> 
> Usage:
> 
> test=# select to_timestamp(200120400);
>       to_timestamp
> ------------------------
>  1976-05-05 14:00:00+09
> (1 row)
> 
> If regression tests are required, I will produce some. I'd appreciate 
> any pointers as to what to look for, as they would be my first attempt 
> at writing regression tests.
> 
> Regards
> 
> Michael Glaesemann
> grzm myrealbox com
> 
> 
> ------------------------------------------------------------------------
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
В списке pgsql-patches по дате отправления
От: Serguei Mokhov
Дата:
От: Andrew Dunstan
Дата:
FAQ