Re: date function bug

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: date function bug
Date: 2019-10-23 14:28:48
Message-ID: a4d04d62-f166-7b91-6e0a-66e06864c2c0@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ravi Krishna 2019-10-23 14:32:30 Re: date function bug
Previous Message Ravi Krishna 2019-10-23 14:28:15 Re: date function bug