3 digit year problem

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: 3 digit year problem
Date: 2002-05-03 07:17:12
Message-ID: GNELIHDDFBOCMGBFGEFOEEHBCCAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Is there any rhyme or reason to these ISO format date parsing rules?

test=# select '1-1-1'::date;
ERROR: Bad date external representation '1-1-1'
test=# select '69-1-1'::date;
date
------------
2069-01-01
(1 row)

test=# select '50-1-1'::date;
date
------------
2050-01-01
(1 row)

test=# select '40-1-1'::date;
date
------------
2040-01-01
(1 row)

test=# select '30-1-1'::date;
ERROR: Bad date external representation '30-1-1'
test=# select '100-1-1'::date;
ERROR: Bad date external representation '100-1-1'
test=# select '999-1-1'::date;
ERROR: Bad date external representation '999-1-1'
test=# select '1000-1-1'::date;
date
------------
1000-01-01
(1 row)

Why can't someone store the year without having to pad with zeros for years
between 100 and 999?

What's wrong with 30-1-1 and below? Why does 40 work and not 30?

Chris

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Manfred Koizar 2002-05-03 07:37:25 Trying to reduce per tuple overhead (bitmap)
Previous Message Doug Needham 2002-05-03 04:03:21 Re: replication questions