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

From Tom Lane
Subject Re: to_timestamp overloaded to convert from Unix epoch
Date
Msg-id 5386.1092500372@sss.pgh.pa.us
Whole thread Raw
In response to Re: to_timestamp overloaded to convert from Unix epoch  (Michael Glaesemann <grzm@myrealbox.com>)
Responses Re: to_timestamp overloaded to convert from Unix epoch
List pgsql-patches
Michael Glaesemann <grzm@myrealbox.com> writes:
> 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'?

> Are you thinking something like to_timestamp(200120400,'unix')?

I didn't see the point of that suggestion either.  People who want to do
this conversion usually want to start with a number, not a string, so
it wouldn't be part of the existing to_timestamp function anyway.

There was however another patch submitted recently that seemed to
duplicate yours functionally but used a different syntax --- I think the
guy had started by looking at extract(epoch from timestamp) rather than
to_timestamp.

            regards, tom lane

pgsql-patches by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: [HACKERS] [Fwd: Re: [pgsql-hackers-win32] Import from Linux to
Next
From: Philip Warner
Date:
Subject: pg_restore recognizing $-quotes