Re: date formatting and tab-complete patch

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: Manuel Sugawara <masm(at)fciencias(dot)unam(dot)mx>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Hackers Mailing List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: date formatting and tab-complete patch
Date: 2001-12-06 09:03:22
Message-ID: 20011206100322.A23044@zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Wed, Dec 05, 2001 at 11:33:26AM -0600, Manuel Sugawara wrote:
> Karel Zak <zakkr(at)zf(dot)jcu(dot)cz> writes:
>
> > > This example shows another issue. With localized month and day names
> > > the hardcoded paddings doesn't make sense any more since you may have
> > > a month name longer than 9 chars -septiembre- as instance.
> >
> > Magic "9 chars" is nice and popular Oracle feature :-)

It was irony :-) I don't know why Oracle has this stupid feature, but
if we want be compatible, we must use it too....

> You think so?, May be it was in the teletype or monospaced display
> times. But now? I don't think so.
>
> > The "9 chars" can be used for English locales only.
>
> May be add a GUC, something like useless_oracle_compatibility turned
> on by default (for the backwards compatibility). Believe me, the

I not sure with some global switch like 'useless_oracle_compatibility',
here must be way how use old and new features together without
restriction.

> paddings are mostly useless those days where aplications tends to use
> more the web or graphical interfaces than terminals or teletypes.

Yesterday I forgot important note: if to_char() will support locales
for datetime output it must be implemented as _new_ feature. It means
this new implementation must be backward compatible for all current
format definition. For example:

to_char(now(), 'Month') _must_forever_output_: 'December '

and this output must be independent on locales setting. It's
important, because a lot of application depend of current output
format. If someone wants use locale depend output must be possible
set it by some format suffix, for example:

to_char(now(), 'LCMonth')

(to_char() already knows work with suffixes, for example FM). And must
be possible mix it in one format definition:

to_char(now(), 'LCMonth Month')

-output-> 'Xxxxxx December '

where 'Xxxxxx' is the Month from locales and 'December ' is output
compatible with current (Oracle) to_char() and is locale independen.

This solve a problem with "9 Chars", because all non-locales output
or compilation without locales support will use it like now.

It's very simular to number formatting by to_char(). There is two
patterns for decimal point, 'D' -- for locale depend deciaml point
and '.' -- for "standard" locales independend. With Months/Days it
must be same.

Right?

Karel

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

C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2001-12-06 10:52:44 Re: Licensing
Previous Message Tatsuo Ishii 2001-12-06 01:39:57 Re: SunOS4 port

Browse pgsql-patches by date

  From Date Subject
Next Message Jrme Courat 2001-12-06 13:45:18 [BASIC FEATURES] stored procedures in Postgresql ?
Previous Message TONY J.Y. 2001-12-05 22:48:52 Can not get large cursor for PGLIB ???