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

date -> text convertion error

From: Petter Reinholdtsen <pere(at)hungry(dot)com>
To: pgsql-bugs(at)postgreSQL(dot)org
Subject: date -> text convertion error
Date: 1999-08-20 12:31:18
Message-ID: 199908201231.OAA02447@lee.Cc.Uit.No (view raw or flat)
Thread:
Lists: pgsql-bugs
I have run into a strange type convertion bug in PostgreSQL.  I have a
table with a 'birtdate' field with type 'date'.  I convert this to
text to reformat it to a string 'DDMMYY'.  A few dates are converted
wrong.  The first example moves the birth date from 25. to 24.:

  pere=> select birthdate, birthdate::text
	 from user_appl where fname = 'Antal';
   birthdate|text
  ----------+----------------------
  1965-04-25|1965-04-24 23:00:00+01
  (1 row)
  
  pere=> select birthdate, birthdate::text
  from user_appl where fname = 'Petter';
   birthdate|text
  ----------+----------------------
  1973-07-11|1973-07-11 00:00:00+01
  (1 row)
 
  pere=>

What is going on, and how can I stop this from happending?

System Configuration
---------------------
  Architecture (example: Intel Pentium)         : Intel Pentium II
  Operating System (example: Linux 2.0.26 ELF)  : RedHat Linux 5.2 / 6.0
  PostgreSQL version (example: PostgreSQL-6.5)  : PostgreSQL-6.5
  Compiler used (example:  gcc 2.8.0)           : gcc 2.7.2.3
-- 
##>  Petter Reinholdtsen <##    | pere(at)td(dot)org(dot)uit(dot)no
 O-  <SCRIPT Language="Javascript">window.close()</SCRIPT>
http://www.hungry.com/~pere/    | Go Mozilla, go! Go!

pgsql-bugs by date

Next:From: Tom LaneDate: 1999-08-20 16:40:46
Subject: Re: [BUGS] date -> text convertion error
Previous:From: guentherDate: 1999-08-20 04:02:39
Subject: timezone mismatch

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