string to date conversion

Поиск
Список
Период
Сортировка
От Jerome Alet
Тема string to date conversion
Дата
Msg-id 20050422084301.GB12176@mail.librelogiciel.com
обсуждение исходный текст
Список pgsql-sql
Hi,

I'm working on an existing Pg database which, please don't ask why,
stores dates as varchar attributes in the form 'YYYY/MM/DD'

I'm not allowed to modify the tables to use 'timestamp' instead,
so I'd like to convert on the fly when retrieving datas with
select.

When I do :
       select mydatefield::timestamp from mytable;       
There's an error saying that converting from varchar to date is        
not possible

How can I do this ?

Thanks in advance

Jerome Alet


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

Предыдущее
От: Christoph Haller
Дата:
Сообщение: Re: RULE for mtime recording
Следующее
От: Jerome Alet
Дата:
Сообщение: Re: string to date conversion