Search Postgresql Archives

Question about PARTIAL DATE type/s

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux