Re: Epoch to timestamp conversion function patch

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Glaesemann <grzm(at)myrealbox(dot)com>
Cc: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Epoch to timestamp conversion function patch
Date: 2004-08-04 17:03:35
Message-ID: 2979.1091639015@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Michael Glaesemann <grzm(at)myrealbox(dot)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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-08-04 17:14:13 Re: More fixes for pg_dump
Previous Message Andrew Dunstan 2004-08-04 13:42:02 Re: make fails if path has spaces