pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
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
Date: Fri, 26 Jun 2020 09:33:02 -0400
Message-ID: <2355328.1593178382@sss.pgh.pa.us> (raw)
In-Reply-To: <16512-edabb2cd446b9c51@postgresql.org>
References: <16512-edabb2cd446b9c51@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> 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





view thread (2+ messages)

Message-ID: <2355328.1593178382@sss.pgh.pa.us>
Permalink:  ../2355328.1593178382@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2355328.1593178382@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, oytf@drivetagdev.com, 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: <2355328.1593178382@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox