Skip site navigation (1) Skip section navigation (2)

Re: to_char and i18n

From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Manuel Sugawara <masm(at)fciencias(dot)unam(dot)mx>, Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: to_char and i18n
Date: 2005-12-22 05:10:00
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-patches
On Wed, 21 Dec 2005, Tom Lane wrote:

> Manuel Sugawara <masm(at)fciencias(dot)unam(dot)mx> writes:
> > (Some time ago I proposed an--incomplete--patch and it was rejectd by
> > Karel arguing that to_char functions should behave *exactly* the same
> > way that they do in Oracle.)
> That is the accepted plan for to_char ... of course, if Oracle changes
> to_char every so often, it'll get more interesting to decide what to do.

There's some functionality in 10g which PostgreSQL does not have:

TZD - returns the short timezone string with daylight saving information,
eg: PDT

TZM - timezone offset minutes part

TZH - timezone offset hours part

TZR -  timezone region (US/Pacific, for example)

RR/RRRR - accept 'rounded' years, eg 99-1-1 = 1999-1-1 (kind of pointless)

FF - specify how many digits to the right of the decimal place to display,
when looking at factions of seconds. Eg: HH:MM:SS.FF3 would produce

X - the local radix character. Eg: HH:MM:SSXFF would produce 15:56:22.123

E - Era name (like, Japanese Imperial) (kind of pointless)
EE - Full era name

DS - Locale formatted short date. For example, DD/MM/YYYY for the Brits,
MM/DD/YYYY for the Yanks

DL - Locale formatted long date. Eg: fmDay, dd. Month yyyy in Germany

SCC - Like 'CC', but will carry a - (minus) for BC dates (I'm not sure if
this implies that Oracle wants BC dates to be marked 'BC'. I don't have
an Oracle system around at the moment to check though :-()

TS - Locale formatted short time.

YEAR - Year in words

SYEAR - Year in words, prefixed by minus sign for BC dates

SYYYY - YYYY, prefixed by minus sign for BC dates


In response to


pgsql-hackers by date

Next:From: Manuel SugawaraDate: 2005-12-22 05:50:06
Subject: Re: to_char and i18n
Previous:From: Manuel SugawaraDate: 2005-12-22 04:58:47
Subject: Re: to_char and i18n

pgsql-patches by date

Next:From: Tatsuo IshiiDate: 2005-12-22 05:11:45
Subject: Re: BUG #2120: Crash when doing UTF8<->ISO_8859_8 encoding
Previous:From: Manuel SugawaraDate: 2005-12-22 04:58:47
Subject: Re: to_char and i18n

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group