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 1j4LK8-0004fn-Gg for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Feb 2020 09:07:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j4LK7-0002q5-83 for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Feb 2020 09:07:15 +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 1j4LK6-0002px-Vn for pgsql-bugs@lists.postgresql.org; Wed, 19 Feb 2020 09:07:15 +0000 Received: from mail-lj1-f195.google.com ([209.85.208.195]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j4LK0-0003r9-Ei for pgsql-bugs@lists.postgresql.org; Wed, 19 Feb 2020 09:07:14 +0000 Received: by mail-lj1-f195.google.com with SMTP id x7so26213434ljc.1 for ; Wed, 19 Feb 2020 01:07:07 -0800 (PST) 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 :content-transfer-encoding; bh=Xsk4nfvv1/5ySvHHqmK7/zI2jsiL4nXdBMnYOfBUA5Y=; b=kXlkJ9YlAVvjD/NOC9Gp+2MqNHcyhihm2bJEY3GnR9xcLhmajT9KUKA93AonVO7xAG 9dAPs0DJWcfqShIjlVRUTaweKHTTqEFuiYRB0U8nAxCnmdRPkulIMu32mbQWvIrUoGdc kT2nkwqvYJ0HTM8G00SIfiRCPcPeZtndQZZzEfnAM9ZvlgoMIh61XX0FNIF9SybZR/B5 3MjBWPngaR92dJwCaj9u00xFozuL6sHRFVt/Mroy2ZeRCzmxOeup2u3OyEF5g2nWsXRY +5ka3HuRHUjf0RXL2AlG4h4zPqMrIbt/ATwWNrfB/dnvdoYiyTgdl8jXVVLGNXEPf4v3 No0Q== X-Gm-Message-State: APjAAAUmYderdgUA8IDFI/aj3xVZVCyFLE1fL0m9cuWNE5W+b5k2pYNN Sk3H7sqEW4LloayQxWV2/LIiburQ X-Google-Smtp-Source: APXvYqxx0BpX4GcHxTcel5DvxPQd/Oj0omaVM3g+mt6uwAxNjzKex9ewsVBcW5aLVh43FCMgI2KcvA== X-Received: by 2002:a2e:b5ce:: with SMTP id g14mr14235581ljn.264.1582103225657; Wed, 19 Feb 2020 01:07:05 -0800 (PST) Received: from [192.168.1.10] (dsl-hkibng22-54f980-150.dhcp.inet.fi. [84.249.128.150]) by smtp.gmail.com with ESMTPSA id e25sm815918ljp.97.2020.02.19.01.07.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Feb 2020 01:07:04 -0800 (PST) Subject: Re: [Bug Report] Week Day To: Atila Rangel , pgsql-bugs@lists.postgresql.org References: From: Heikki Linnakangas Message-ID: Date: Wed, 19 Feb 2020 11:07:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 19/02/2020 04:59, Atila Rangel wrote: > Hi, I'm a software developer working with Postgresql database. Recently, > I have had a issue with Week Day queries. Basically, I tried to filter > some datetime based on day of week name. I'm sending a sql that you can > reproduce the bug. This may not be a bug. But, I would like to report this. The to_char() function pads the weekday names with spaces, as you can see with this query: postgres=# select *, 'X' || to_char(some_date, 'day')::text || 'X' from postgres_report_bug limit 5; id | some_date | ?column? ----+------------------------+------------- 1 | 2019-11-11 00:00:00+02 | Xmonday X 2 | 2019-11-11 01:00:00+02 | Xmonday X 3 | 2019-11-11 02:00:00+02 | Xmonday X 4 | 2019-11-11 03:00:00+02 | Xmonday X 5 | 2019-11-11 04:00:00+02 | Xmonday X (5 rows) You can use 'FMday' instead of 'day' to avoid that. - Heikki