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 1jooTd-0003aL-Hs for pgsql-bugs@arkaria.postgresql.org; Fri, 26 Jun 2020 13:33:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jooTc-0006Tb-EB for pgsql-bugs@arkaria.postgresql.org; Fri, 26 Jun 2020 13:33:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jooTc-0006TU-8G for pgsql-bugs@lists.postgresql.org; Fri, 26 Jun 2020 13:33:08 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jooTZ-0003Qk-VI for pgsql-bugs@lists.postgresql.org; Fri, 26 Jun 2020 13:33:07 +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 05QDX2Oh2355329; Fri, 26 Jun 2020 09:33:02 -0400 From: Tom Lane To: oytf@drivetagdev.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16512: Character considered as a number by regex but can not convert to numeric In-reply-to: <16512-edabb2cd446b9c51@postgresql.org> References: <16512-edabb2cd446b9c51@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Fri, 26 Jun 2020 10:44:03 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2355327.1593178382.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Fri, 26 Jun 2020 09:33:02 -0400 Message-ID: <2355328.1593178382@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form writes: > When installed Postgresql 12.3 for testing purposes we have discovered > following possible bug: > Character "8" (different from standard number 8) is treated as a number by > regular expression > ~'\d+' > but can not be converted to numeric by > ::numeric I see no reason to consider this a bug. The set of characters matched by \d is, as documented, dependent on your collation choice or locale settings (LC_CTYPE in particular). We are not going to try to guess at what random Unicode glyphs might be included in a particular locale, much less make numeric_in take them all. If you want to know whether a string is acceptable to numeric_in I'd suggest writing something based around [0-9] not \d. regards, tom lane