Unpredictable text -> date implicit casting behaviour/to_date bug

Поиск
Список
Период
Сортировка
От Aasmund Midttun Godal
Тема Unpredictable text -> date implicit casting behaviour/to_date bug
Дата
Msg-id 20011231143815.8427.qmail@213-145-170-138.dd.nextgentel.com
обсуждение исходный текст
Ответы Re: Unpredictable text -> date implicit casting behaviour/to_date bug  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
The implicit casting of text to date is normally quite good, however i think it should only use one method during a
givenquery (or maybe transaction?) or maybe it should give a notice of some sort? - i was quite astonished when I
discoveredthe following: (look closely at row 4 and 5 vs the others)
 

SELECT ordredato, ordredato::date from old_faktura where status = 'ORD';ordredato |  ?column?  
-----------+------------18.10.01  | 2001-10-1831.10.01  | 2001-10-3101.11.01  | 2001-01-1103.11.01  |
2001-03-1103.11.01 | 2001-03-1110.11.01  | 2001-10-1126.11.01  | 2001-11-26
 


Added to the fact that to_date has a bug:

SELECT ordredato, ordredato::date, to_date(ordredato, 'DD.MM.YY') from old_faktura where status = 'ANN';ordredato |
?column? |    to_date    
 
-----------+------------+---------------18.04.00  | 2000-04-18 | 0001-04-18 BC30.08.01  | 2001-08-30 |
2001-08-3018.04.00 | 2000-04-18 | 0001-04-18 BC
 

It sometimes makes converting dates a little challenge...

Aasmund Midttun Godal

aasmund@godal.com - http://www.godal.com/
+47 40 45 20 46


В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: RIGHT JOIN Table Ordering Question
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Unpredictable text -> date implicit casting behaviour/to_date bug