Re: to_char(interval) --- done? - Mailing list pgsql-hackers

From Josh Berkus
Subject Re: to_char(interval) --- done?
Date
Msg-id 200303250928.09437.josh@agliodbs.com
Whole thread Raw
In response to to_char(interval) --- done?  (Josh Berkus <josh@agliodbs.com>)
Responses Re: to_char(interval) --- done?  (Karel Zak <zakkr@zf.jcu.cz>)
List pgsql-hackers
Karel,

>  If I see this I must agree with Peter that to_char() is something
>  other than "interval" to "interval-as-string" convertor. The current
>  code use date/time as complex of date/time information _based_ on
>  calendar practice --
>  The other words: current to_char(interval) is interval to calendar
>  date/time convertor.

Currently, yes.   The reason why I'm advocating for a change is:

1) I can't imagine of what use the current behavior could possibly be.  Is
there anyone at all using the current output of to_char(interval)?

2) to_char() is also used for converting numeric values to strings.   It is
not in some way tied to date/time from a schema perspective, although it may
be codewise.

>  I think we can do with the current to_char(interval):
>
>     a) maintain it as "interval" to "calendar date/time string" convertor,
>     b) if nobody wants to use it as a) we can delete it from sources
>        and don't waste our time with it and use our time to real
>        "interval" convertor.

This sounds reasonable to me.  I'll even do a survey on the SQL list to see if
anyone there is using the current behavior.

--
Josh Berkus
Aglio Database Solutions
San Francisco



pgsql-hackers by date:

Previous
From: Lee Kindness
Date:
Subject: Bison 1.875 now required.
Next
From: "Anton V. Kozub"
Date:
Subject: New structers for optimazing R-tree