Re: Epoch to timestamp conversion function patch - Mailing list pgsql-patches

From Tom Lane
Subject Re: Epoch to timestamp conversion function patch
Date
Msg-id 2979.1091639015@sss.pgh.pa.us
Whole thread Raw
In response to Epoch to timestamp conversion function patch  (Michael Glaesemann <grzm@myrealbox.com>)
Responses Re: Epoch to timestamp conversion function patch  (Michael Glaesemann <grzm@myrealbox.com>)
List pgsql-patches
Michael Glaesemann <grzm@myrealbox.com> writes:
> Please find attached two patches (one for pg_proc.h and another for
> supporting documentation) for two SQL functions:
> epoch_to_timestamp(integer) and epoch_to_timestamptz(double precision),
> which convert from UNIX epoch to the native PostgreSQL timestamp and
> timestamptz data types. The equivalent SQL code is

Why wouldn't these both take double precision?

Actually I think epoch_to_timestamp as such is just plain unnecessary.
I'd suggest just one function epoch_to_timestamp that actually yields
timestamptz, and then if casting the result to timestamp is needed it'll
happen automatically.

            regards, tom lane

pgsql-patches by date:

Previous
From: "Matthew T. O'Connor"
Date:
Subject: Autovacuum Integration Patch Take 5
Next
From: Tom Lane
Date:
Subject: Re: More fixes for pg_dump