Re: date function bug - Mailing list pgsql-general

From Ron
Subject Re: date function bug
Date
Msg-id a4d04d62-f166-7b91-6e0a-66e06864c2c0@gmail.com
Whole thread Raw
In response to date function bug  ("Abraham, Danny" <danny_abraham@bmc.com>)
Responses Re: date function bug
List pgsql-general
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.



pgsql-general by date:

Previous
From: Ravi Krishna
Date:
Subject: Re: date function bug
Next
From: Ravi Krishna
Date:
Subject: Re: date function bug