RE: date function bug - Mailing list pgsql-general

From Kevin Brannen
Subject RE: date function bug
Date
Msg-id DM6PR19MB3451B74FE5D084C0B2F08612A46B0@DM6PR19MB3451.namprd19.prod.outlook.com
Whole thread Raw
In response to Re: date function bug  (Ravi Krishna <sr_krishna@aol.com>)
Responses Re: date function bug
List pgsql-general

From: Ravi Krishna <sr_krishna@aol.com>


> postgres=# select to_date('2018150X','YYYYMMDD');
  > to_date
------------
> 2019-03-03


> postgres=# select to_date('20181501','YYYYMMDD');
>  to_date
> ------------
  > 2019-03-03


is this a cut-n-paste mistake?

 

====================

Surprisingly (to me), no….

db=# select to_date('20181501','YYYYMMDD');

  to_date

------------

2019-03-03

(1 row)

 

Time: 0.497 ms

nms=# select version();

                                                 version

----------------------------------------------------------------------------------------------------------

PostgreSQL 9.6.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16), 64-bit

(1 row)

 

Time: 0.247 ms

db=#

 



This e-mail transmission, and any documents, files or previous e-mail messages attached to it, may contain confidential information. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are hereby notified that any disclosure, distribution, review, copy or use of any of the information contained in or attached to this message is STRICTLY PROHIBITED. If you have received this transmission in error, please immediately notify us by reply e-mail, and destroy the original transmission and its attachments without reading them or saving them to disk. Thank you.

pgsql-general by date:

Previous
From: Ron
Date:
Subject: Re: date function bug
Next
From: Tom Lane
Date:
Subject: Re: date function bug