Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lXma8-0002W0-O0 for pgsql-bugs@arkaria.postgresql.org; Sat, 17 Apr 2021 15:10:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lXma7-0008Uc-N4 for pgsql-bugs@arkaria.postgresql.org; Sat, 17 Apr 2021 15:09:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lXma7-0008UV-H5 for pgsql-bugs@lists.postgresql.org; Sat, 17 Apr 2021 15:09:59 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lXma5-0007s2-6c for pgsql-bugs@lists.postgresql.org; Sat, 17 Apr 2021 15:09:59 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 13HF9rBt256549; Sat, 17 Apr 2021 11:09:53 -0400 From: Tom Lane To: "Fontana Daniel C. \(Desartec S.R.L.\)" cc: pgsql-bugs@lists.postgresql.org Subject: Re: function to_char In-reply-to: <001b01d7339a$c42a84e0$4c7f8ea0$@gmail.com> References: <001b01d7339a$c42a84e0$4c7f8ea0$@gmail.com> Comments: In-reply-to "Fontana Daniel C. \(Desartec S.R.L.\)" message dated "Sat, 17 Apr 2021 12:03:02 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <256547.1618672193.1@sss.pgh.pa.us> Date: Sat, 17 Apr 2021 11:09:53 -0400 Message-ID: <256548.1618672193@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Fontana Daniel C. \(Desartec S.R.L.\)" writes: > Example, select length (to_char (1, '990')) > returns 4 because? Per the fine manual: * If no explicit provision is made for a sign in to_char()'s pattern, one column will be reserved for the sign, and it will be anchored to (appear just left of) the number. If S appears just left of some 9's, it will likewise be anchored to the number. If you don't want to leave space for a sign, it looks like FM is the only way to do that. regards, tom lane