General Bug Report: Two digit years are inconsistant in psql - Mailing list pgsql-bugs

From Unprivileged user
Subject General Bug Report: Two digit years are inconsistant in psql
Date
Msg-id 199905212137.RAA69378@hub.org
Whole thread Raw
List pgsql-bugs
============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name               : Keith Paskett
Your email address      : keith.paskett@sdl.usu.edu

Category                : unknown
Severity                : non-critical

Summary: Two digit years are inconsistant in psql

System Configuration
--------------------
  Operating System   : sparc-sun-solaris2.7

  PostgreSQL version : 6.4.2

  Compiler used      : gcc 2.8

Hardware:
---------


Versions of other tools:
------------------------


--------------------------------------------------------------------------

Problem Description:
--------------------
In a date entered as '01-02-03' the last number is used for
the year but entering '33-04-05' the first number is used
for the year.

It turns out that if the first number is a valid day number
(1 to 31) it is used as the day. Otherwise it is used as a
two digit year.

--------------------------------------------------------------------------

Test Case:
----------
create table test (dt date);
insert into test values('01-02-03');
insert into test values('33-04-05');
insert into test values('28-06-07');
select * from test;
        dt
----------
01-02-2003
04-05-2033
06-28-2007


--------------------------------------------------------------------------

Solution:
---------


--------------------------------------------------------------------------


pgsql-bugs by date:

Previous
From: Georgi Georgiev
Date:
Subject: Debian Linux install note
Next
From: Fomichev Michael
Date:
Subject: Bug or not ?