Re: to_char(interval) --- done?

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Larry Rosenman <ler(at)lerctr(dot)org>, Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: to_char(interval) --- done?
Date: 2003-03-26 07:01:40
Message-ID: 20030326070140.GA27912@zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 25, 2003 at 09:28:09AM -0800, Josh Berkus wrote:
> 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)?

IMHO nobody use it -- maybe we can keep it in sources for 7.4 and
mark it in docs as deprecated and remove it in 7.5.

> 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.

The date/time and numbers formatting share parser only. The current
to_char(interval) is 20 lines of code only.

> > 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.

I want to write new library "libformattig", because I need to_char()
features and some new extensions in the others projects -- it means
in 7.5 will new to_char() code. The current code works without bugs,
but it is not ideal code.

Karel

--
Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
http://home.zf.jcu.cz/~zakkr/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jinqiang Han 2003-03-26 09:19:38 inquiry
Previous Message Han 2003-03-26 05:27:23 Re: updateable cursors & visibility