Search Postgresql Archives

Re: date function bug

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

 



On 10/23/19 9:22 AM, Abraham, Danny wrote:
Hi,

The function "to_date" does not fail illegal values.
Is this a known bug?
What is the recommended type checking?


ctrlmdb=> select to_date('2018100X','YYYYMMDD');
   to_date
------------
  2018-10-01
(1 row)

psql (9.6.15)
Type "help" for help.

postgres=# select to_date('2018100X','YYYYMMDD');
  to_date
------------
 2018-10-01
(1 row)

postgres=#
postgres=# select to_date('2018150X','YYYYMMDD');
  to_date
------------
 2019-03-03
(1 row)

postgres=# select to_date('20181501','YYYYMMDD');
  to_date
------------
 2019-03-03
(1 row)



--
Angular momentum makes the world go 'round.





[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