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'?
Thanks for looking at the code! I know people are really busy now with
8.0.0beta1.
Are you thinking something like to_timestamp(200120400,'unix')? One
thing that I was thinking about when looking at the docs is that the
other to_ functions (other than to_char) took first a text-based
argument, and then the format. This to_timestamp takes (or casts to) a
double.
I can see how it might be forward-looking to have two parameters in
case we wanted to convert from some other numeric-based timestamp to
timestamptz; just change the formatting parameter. Two things come time
mind:
(1) I can't think of an instance when someone has asked to convert from
some other numeric-based timestamp.
(2) If the day comes when we would want to add another conversion,
nothing prevents us from creating it (though retaining the
one-parameter version for backwards-compatibility might be a reason
against this).
Thoughts?
Michael Glaesemann
grzm myrealbox com