From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: date function bug
Date: Wed, 23 Oct 2019 09:28:48 -0500
Message-ID: <a4d04d62-f166-7b91-6e0a-66e06864c2c0@gmail.com> (raw)
In-Reply-To: <0bac35bcde6747e485bc7468c4080798@phx-exmbprd-01.adprod.bmc.com>
References: <0bac35bcde6747e485bc7468c4080798@phx-exmbprd-01.adprod.bmc.com>
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: ronljohnsonjr@gmail.com
Subject: Re: date function bug
In-Reply-To: <a4d04d62-f166-7b91-6e0a-66e06864c2c0@gmail.com>
References: <0bac35bcde6747e485bc7468c4080798@phx-exmbprd-01.adprod.bmc.com> <a4d04d62-f166-7b91-6e0a-66e06864c2c0@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox