Re: A creepy story about dates. How to prevent it?

From: Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: A creepy story about dates. How to prevent it?
Date: 2003-06-24 16:01:14
Message-ID: 5.2.1.1.1.20030624231310.02e373f0@mbox.jaring.my
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

At 03:24 PM 6/23/2003 -0400, Bruce Momjian wrote:

>Added to TODO, with question mark:
>
> * Have initdb set DateStyle based on locale?

Given various issues with locale (indexes, ordering etc) I'd think that
having a DB follow the O/S locale should be special case and require
explicit configuration.

More so if certain locales are significantly slower than others which
seemed to be the case at least in recent memory.

What if a European DB backed website is hosted on a US server with English,
French and German data?

If apps/programs are talking to DBs more than people are then it may make
more sense to store things in an application friendly format e.g. (date =
YYYY-MM-DD, or seconds since epoch) format and having the app convert it
based on the user's preferences. After all even in English, apps may choose
to display Tuesday as T, Tue, Tuesday, or whatever the Boss wants.

Unless postgresql has special features allowing switching from one locale
to another on the fly (including indexes, ordering etc) within a DB
session, I'd rather stick to say the C locale, or whatever it is that's
fastest.

Another point of consideration: if someone accidentally loads
multibyte/other locale data into a C locale DB (or whatever is chosen as
default DB locale), would dumping the loaded data and reloading it into a
multibyte locale result in information/precision loss?

Link.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message PeterKorman 2003-06-24 16:16:01 Re: Running pg_dump under vcron
Previous Message s 2003-06-24 15:54:15 postgres 7.3.3 problem - not talking across port