Re: to_timestamp overloaded to convert from Unix epoch - Mailing list pgsql-patches

From Christopher Kings-Lynne
Subject Re: to_timestamp overloaded to convert from Unix epoch
Date
Msg-id 411DE079.1070207@familyhealth.com.au
Whole thread Raw
In response to to_timestamp overloaded to convert from Unix epoch  (Michael Glaesemann <grzm@myrealbox.com>)
Responses Re: to_timestamp overloaded to convert from Unix epoch  (Michael Glaesemann <grzm@myrealbox.com>)
List pgsql-patches
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 by date:

Previous
From: "Serguei Mokhov"
Date:
Subject: Translation updates for 8.0: initdb-ru, psql-ru
Next
From: Andrew Dunstan
Date:
Subject: Re: [HACKERS] [Fwd: Re: [pgsql-hackers-win32] Import from Linux to