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

Re: CC Date format code defaults to current centry

From: Andre Maasikas <andre(at)abs(dot)ee>
To:
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: CC Date format code defaults to current centry
Date: 2005-03-14 11:11:58
Message-ID: 4235717E.5050304@abs.ee (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-patches
Bruce Momjian wrote:
> Joe Brown wrote:
> 
>>joe=> select to_date('19450323','CCYYMMDD');
>>  to_date  
>>------------
>> 2045-03-23
>>(1 row)
>>
>>joe=> select to_date('19450323','YYYYMMDD');
>>  to_date  
>>------------
>> 1945-03-23
>>(1 row)
>>
>>I thought the former would be "more" correct.  But it seems I am mistaken.
> 
> 
> Uh, 1945 _is_ in the 20th century, but I can see how it is confusing.
> 
Yes, but the other way around: to_date('19450323','CCYYMMDD')
shoold be a year in the 19th century?

ps another db seems to disallow CC on input - maybe because one can
get into weird situations like to_date('2005 18','YYYY CC') or something 
similar.

Andre


In response to

pgsql-bugs by date

Next:From: Ales VojacekDate: 2005-03-14 11:55:09
Subject: BUG #1543: Problem with restore DB
Previous:From: Andrew SlobodyanykDate: 2005-03-14 10:46:07
Subject: BUG #1542: pg_dump seg fault

pgsql-patches by date

Next:From: Bruce MomjianDate: 2005-03-14 18:28:43
Subject: Re: submitted WIN1252 patches are buggy
Previous:From: Simon RiggsDate: 2005-03-14 08:17:48
Subject: Re: [GENERAL] A way to let Vacuum warn if FSM settings

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