Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mH4h6-0001DW-Mi for pgsql-bugs@arkaria.postgresql.org; Fri, 20 Aug 2021 13:36:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mH4h5-00052l-KY for pgsql-bugs@arkaria.postgresql.org; Fri, 20 Aug 2021 13:36:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mH4h5-00052b-E7 for pgsql-bugs@lists.postgresql.org; Fri, 20 Aug 2021 13:36:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mH4h0-0006Qq-W4 for pgsql-bugs@lists.postgresql.org; Fri, 20 Aug 2021 13:36:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 17KDaGCv1851839; Fri, 20 Aug 2021 09:36:16 -0400 From: Tom Lane To: 66666666nikita@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17155: Casting to type date In-reply-to: <17155-a946f3b2c515d07f@postgresql.org> References: <17155-a946f3b2c515d07f@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Fri, 20 Aug 2021 11:19:04 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1851837.1629466576.1@sss.pgh.pa.us> Date: Fri, 20 Aug 2021 09:36:16 -0400 Message-ID: <1851838.1629466576@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > In the previous version 12.6, the date cast is handled without errors, but > in version 12.8 this generates an error > SELECT '20.08.2021'::date Nothing has changed in that area in quite some time. I don't have a 12.6 installation immediately at hand, but I did find 12.2 laying about on my laptop, and it behaves the same way as 12.8: $ psql postgres psql (12.2) Type "help" for help. postgres=# SELECT '20.08.2021'::date; ERROR: date/time field value out of range: "20.08.2021" LINE 1: SELECT '20.08.2021'::date; ^ HINT: Perhaps you need a different "datestyle" setting. The HINT's recommendation is accurate: postgres=# set datestyle = dmy; SET postgres=# SELECT '20.08.2021'::date; date ------------ 2021-08-20 (1 row) So I suspect you forgot to transfer your datestyle setting to the new installation. regards, tom lane