| From: | Michael Glaesemann <grzm(at)myrealbox(dot)com> |
|---|---|
| To: | PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org> |
| Subject: | to_timestamp overloaded to convert from Unix epoch |
| Date: | 2004-08-12 05:32:47 |
| Message-ID: | 0B80ACA6-EC21-11D8-831D-000A95C88220@myrealbox.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-patches |
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
| Attachment | Content-Type | Size |
|---|---|---|
| to_timestamp.diff | application/octet-stream | 3.0 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Martin Münstermann | 2004-08-12 06:42:15 | Re: 8.0.0beta1: -lpthread missing |
| Previous Message | Philip Warner | 2004-08-12 04:32:46 | Re: pg_dump 'die_on_errors' |