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 1iNHrR-0004sP-Jk for pgsql-general@arkaria.postgresql.org; Wed, 23 Oct 2019 14:43:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iNHrP-0000x6-Vd for pgsql-general@arkaria.postgresql.org; Wed, 23 Oct 2019 14:43:39 +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 1iNHrP-0000wz-Jr for pgsql-general@lists.postgresql.org; Wed, 23 Oct 2019 14:43:39 +0000 Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iNHrI-0004G0-Tx for pgsql-general@lists.postgresql.org; Wed, 23 Oct 2019 14:43:39 +0000 Received: by mail-ot1-x336.google.com with SMTP id z6so17646585otb.2 for ; Wed, 23 Oct 2019 07:43:32 -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-language; bh=MunokqG3rx+PN+RMCgAGYSCH4BWtmvVBWyBljpGPk0Y=; b=dm0K/5F2ADKWYQx7bDM/VorTIAuYoQ4eZmRq+y+h+5ZVwoKO/TD36+aVvDxjV5OlrK je/yON9gID512umY2UseLgdFlroaxImGohyWetpNGinp/OsbfzL5W5UrpdmmvRyrQScR K8EhJOZiH5WbUzcvjYS2S+rhaZqo7+OnC9wL9PCPFBEBZ4wkME7QEyRqvHx1YAe33d8S P2mklwyoAzIA6Ok/WIsjXx5HaLNoqCLudAzvBDV6GNFhKYMc1Iml5+lBIhTEYLw+SP+N rAjY18y5tM+mboUkPlBzXyrq95tAwNsevtwETgaouGNf9gVhr1MI4Oh3FJtKdg3fltx7 h0Gg== 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-language; bh=MunokqG3rx+PN+RMCgAGYSCH4BWtmvVBWyBljpGPk0Y=; b=OL+tcgmSQEl5zSCw9O6C3wLFLLFg+mWrYiBDmkYeNfwqVrKfoLqSanXjkVweAC2DIY +UgcsMsTiR29wNFlvCncOQVkRT3TIcSH4TY+hoToxh5ya6erpJ0L0ST4glpEHezMNM5m ZfWzoRYFY73qwYytkXP7obemI0fASzCniHu94JhVYwWJrFfQK8ztwd2j3EvY0DMLJbXN UTPukls+pdEnqSR+jcsP9CAtfVBuHp7J95g3RPFBYI11OfWmR+FjD2UNo2ii30Wd+0Rs 2O++GxkpAZwBq1eR06Vw19ivxIF8eKagfoqK+wzXAGZZ87Uy4j//Za5D6uWfvqyXUuFV ArzA== X-Gm-Message-State: APjAAAXwPbREi2w0xbSCf6QThO/EHoJ5qNws3XUNOG4BPS5nFqiEbSbO EapFrHwJA+Pc9e9wA5ONdpy4ctAuB7Cysw== X-Google-Smtp-Source: APXvYqy/aI+UyG6o856+hj/wpcnUvLtHk3uwcZ3cV6tR0k1OjFxHr7k/1r73y0Mclx0yKdY4TjRhWQ== X-Received: by 2002:a9d:538d:: with SMTP id w13mr3302480otg.184.1571841810167; Wed, 23 Oct 2019 07:43:30 -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 q9sm1888718otc.53.2019.10.23.07.43.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Oct 2019 07:43:29 -0700 (PDT) Subject: Re: date function bug To: pgsql-general@lists.postgresql.org References: <0bac35bcde6747e485bc7468c4080798@phx-exmbprd-01.adprod.bmc.com> <1793586722.3867823.1571841150028@mail.yahoo.com> From: Ron Message-ID: <1629fd7f-af28-62ad-4dac-4e60ad981b41@gmail.com> Date: Wed, 23 Oct 2019 09:43:28 -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: <1793586722.3867823.1571841150028@mail.yahoo.com> Content-Type: multipart/alternative; boundary="------------3B891625E00558FD76030FB1" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------3B891625E00558FD76030FB1 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 10/23/19 9:32 AM, Ravi Krishna wrote: > > > 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? Nope. Here's the screen print: http://i.imgur.com/f0UXfZh.png -- Angular momentum makes the world go 'round. --------------3B891625E00558FD76030FB1 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 10/23/19 9:32 AM, Ravi Krishna wrote:

> 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?

Nope.

Here's the screen print: http://i.imgur.com/f0UXfZh.png

--
Angular momentum makes the world go 'round.
--------------3B891625E00558FD76030FB1--