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

General Bug Report: Two digit years are inconsistant in psql

From: Unprivileged user <nobody>
To: pgsql-bugs(at)postgresql(dot)org
Subject: General Bug Report: Two digit years are inconsistant in psql
Date: 1999-05-21 21:37:12
Message-ID: 199905212137.RAA69378@hub.org (view raw or flat)
Thread:
Lists: pgsql-bugs
============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name               : Keith Paskett
Your email address      : keith(dot)paskett(at)sdl(dot)usu(dot)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

Next:From: Fomichev MichaelDate: 1999-05-26 01:21:06
Subject: Bug or not ?
Previous:From: Georgi GeorgievDate: 1999-05-20 09:12:08
Subject: Debian Linux install note

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