pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: 66666666nikita@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17155: Casting to type date
Date: Fri, 20 Aug 2021 09:36:16 -0400
Message-ID: <1851838.1629466576@sss.pgh.pa.us> (raw)
In-Reply-To: <17155-a946f3b2c515d07f@postgresql.org>
References: <17155-a946f3b2c515d07f@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> 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





view thread (2+ messages)

Message-ID: <1851838.1629466576@sss.pgh.pa.us>
Permalink:  ../1851838.1629466576@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1851838.1629466576@sss.pgh.pa.us

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, 66666666nikita@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17155: Casting to type date
  In-Reply-To: <1851838.1629466576@sss.pgh.pa.us>

* 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