Question about PARTIAL DATE type/s

Поиск
Список
Период
Сортировка
От r d
Тема Question about PARTIAL DATE type/s
Дата
Msg-id CALtFtEK35HqMr34hKyyCTV2g522fpiJK+6qAS6rZVdeTWgWS5g@mail.gmail.com
обсуждение исходный текст
Ответы Re: Question about PARTIAL DATE type/s  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Список pgsql-general
Hi,

I have text fields which contains dates in the format 'YYYYMM' (four positions for the year, two for the month).
These fields are contained in text files which I load into the DB.

When I convert this field to a date using 

        to_date("PARTIAL_DATE_FIELD",'YYYYMM'); -- (a cast won't recognize the input as valid)

I still get full dates as an output, for example, 
        '198801' ---> 1988-01-01
        '196408' ---> 1964-08-01
and so on, what is wrong in this case because nowhere it is said that I have the /first/ of that month, the entry just says that the event in question happened /during/ that month.


My question:
Is it possible to define fields which contain partial dates per above? I found nothing in the manual.


Thanks,

RD

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

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: Help with query timeout
Следующее
От: Daniele Varrazzo
Дата:
Сообщение: Re: Question about PARTIAL DATE type/s