PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID16512
PG Version12.3
OSWindows 10
Opened2020-06-26 10:44:03+00
Reported bytester375
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      16512
Logged by:          tester375
Email address:      (redacted)
PostgreSQL version: 12.3
Operating system:   Windows 10
Description:        

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

How to reproduce the bug:
Command:
SELECT '8' ~ '\d+'
returns "false" for PostgreSQL 10.4 on both Windows 10 and CentOS Linux 7
returns "false" for PostgreSQL 11.5 on CentOS Linux 7
returns "true" for PostgreSQL 12.3 on Windows 10 - but in this case,
character still can not be converted to numeric.

This behavior causes obvious problems when using data type conversion
like:
CASE WHEN column1 ~ '\d+' THEN column1::numeric AS column2
Error: '8' can not be cast to numeric

Messages

DateAuthorSubject
2020-06-26 10:44:03+00PG Bug reporting formBUG #16512: Character considered as a number by regex but can not convert to numeric
2020-06-26 13:33:02+00Tom LaneRe: BUG #16512: Character considered as a number by regex but can not convert to numeric
2020-07-09 17:07:51+00tester357Re: BUG #16512: Character considered as a number by regex but can not convert to numeric
2020-07-09 20:29:11+00Tom LaneRe: BUG #16512: Character considered as a number by regex but can not convert to numeric