Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iNHdA-0004AV-HZ for pgsql-general@arkaria.postgresql.org; Wed, 23 Oct 2019 14:28:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iNHd9-0002tl-9D for pgsql-general@arkaria.postgresql.org; Wed, 23 Oct 2019 14:28:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iNHd8-0002te-UG for pgsql-general@lists.postgresql.org; Wed, 23 Oct 2019 14:28:55 +0000 Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iNHd6-00047g-Ph for pgsql-general@lists.postgresql.org; Wed, 23 Oct 2019 14:28:54 +0000 Received: by mail-ot1-x343.google.com with SMTP id z6so17599851otb.2 for ; Wed, 23 Oct 2019 07:28:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=3H7T4CyjJkurco0qhynbia/5McXrRX5rOl+BhwKezzI=; b=snu/xjOlKIVZPgvGu4CXh+wJcnvhxurawrtgOPOgxCh6oThvAAsuDd9CKzp9S3/qDA q+jCg4G41rOv3R/SGr+V5RoAuym4P3i1qJ97+MKjZKhPEMCIx03Ym/tKVXXpM1b73PTW pYCm5Mb5kwHF2kxvDfLTLfgeXYFTW7wOIMhpOOf3wmKQ4nnSbLT8NKJk9ZzO6b0+5Rk+ qRACb2d+WsSW7Vw4rHdGwV5WeMB2UfWThupWWrmIkEIpxC391Ih7FM/iabd13MF4FtKn N3pM53zWQoHYJ3Co25wXmZD8gaB/e8OM19gTrG0+dNas/tRn4J2YGbwlKvlfoK/z9ipe ncvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=3H7T4CyjJkurco0qhynbia/5McXrRX5rOl+BhwKezzI=; b=HUOrdPVTaq9EuugfH56+nd4XZoVB0/YmWgw8B/9KrMz0/EJXa1MvuiM2+6uABY1Z3h h8kyGUr+PwtjCd7z7nX1eShrUKTgQZ8YJC4Yod7R5b5sK0WZsLz7D9/2/WR1EXgdjLpc 0r/ZmHgOCPFoqajSby4Hfq+dKAg95vPwNGw3MS4bF8OuJ+R0FqGUOd2WqFHgzd6isy1R NTe2rXmRE7Y6pkADRNWp9aKjOQwdsQNQP6crOyuGNdpG3SgdCYaZHMgDoYmm4jXazjr+ WYr2z1Zs39xDPEHtbyP3Gtnz3EMenEI380khgSpkfanptfZ7az68c7mqvr9GFgKAH2aG HUMg== X-Gm-Message-State: APjAAAXc65C7yObRIDQ2FPHtXdGoDqW95KyGkyM1GWbXkE0va1EJHoCx gXYw2YtkP+vBAgHs7bohvWeVpG3HCBf8RA== X-Google-Smtp-Source: APXvYqwDh0/YhHS3gGxLgJP5huvkDRKF/HVwg7q2GGw7SmAm+PcYuXoa/WGK/nt/M3pfEU9VtYs7mQ== X-Received: by 2002:a9d:3df7:: with SMTP id l110mr7134935otc.245.1571840930398; Wed, 23 Oct 2019 07:28:50 -0700 (PDT) Received: from [192.168.1.10] (ip70-186-126-197.no.no.cox.net. [70.186.126.197]) by smtp.googlemail.com with ESMTPSA id u130sm5684929oib.56.2019.10.23.07.28.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Oct 2019 07:28:49 -0700 (PDT) Subject: Re: date function bug To: pgsql-general@lists.postgresql.org References: <0bac35bcde6747e485bc7468c4080798@phx-exmbprd-01.adprod.bmc.com> From: Ron Message-ID: Date: Wed, 23 Oct 2019 09:28:48 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <0bac35bcde6747e485bc7468c4080798@phx-exmbprd-01.adprod.bmc.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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.