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.