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 1ix9FF-0004V0-Me for pgsql-bugs@arkaria.postgresql.org; Thu, 30 Jan 2020 12:48:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ix9FE-0003ry-Dy for pgsql-bugs@arkaria.postgresql.org; Thu, 30 Jan 2020 12:48:28 +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 1ix9FE-0003rl-5s for pgsql-bugs@lists.postgresql.org; Thu, 30 Jan 2020 12:48:28 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ix9FB-0003r9-1O for pgsql-bugs@lists.postgresql.org; Thu, 30 Jan 2020 12:48:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:To:Sender:From:Date:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=7YuCLQmrEdw6kjk2ZHUOxjRpKvyR5L+ljZi1rchWFLY=; b=cQd7WoRheH6kVtBUDA09SPo9dU mC5K7M3RpzajWhJbDhQn3WsmgAVwIgMmJbAoJsrkzdomBb11d4QBUP01km5Mvq2f9yHq1+NI37GJ4 2ZVcF8QJ7yUd4he8TVYvlTLbTvluc/h2pzI98O3btATU8UEEvgQ+7WzFlkWQdwMLb/mY=; Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by depesz.com with esmtpa (Exim 4.92) (envelope-from ) id 1ix9F9-0003g4-Fs; Thu, 30 Jan 2020 13:48:23 +0100 Date: Thu, 30 Jan 2020 13:48:23 +0100 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: memnik@hotmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16238: Function " to_char(timestamp, text) " doesn't work properly Message-ID: <20200130124823.GA7512@depesz.com> Reply-To: depesz@depesz.com References: <16238-3008a3b37b41cb0e@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <16238-3008a3b37b41cb0e@postgresql.org> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Jan 30, 2020 at 11:49:45AM +0000, PG Bug reporting form wrote: > For example this query " > select to_char('2020-01-29'::date,'Day') " give me this result "Wednesday", > but this query " select to_char('2020-01-31'::date,'Day') " give me this > result "Friday ". > So, i guess it is not right to have days with many spaces as a result and > some days without any space. First of all - it's not a bug - function works exactly as documented: https://www.postgresql.org/docs/current/functions-formatting.html#FUNCTIONS-FORMATTING-DATETIME-TABLE says: "Day" -> full capitalized day name (blank-padded to 9 chars). If you don't want the padding, use FM modifier, like: select to_char('2020-01-31'::date,'FMDay'); Best regards, depesz