BUG #16512: Character considered as a number by regex but can not convert to numeric
| От | PG Bug reporting form |
|---|---|
| Тема | BUG #16512: Character considered as a number by regex but can not convert to numeric |
| Дата | |
| Msg-id | 16512-edabb2cd446b9c51@postgresql.org обсуждение исходный текст |
| Ответы |
Re: BUG #16512: Character considered as a number by regex but can not convert to numeric
|
| Список | pgsql-bugs |
The following bug has been logged on the website: Bug reference: 16512 Logged by: tester375 Email address: oytf@drivetagdev.com 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
В списке pgsql-bugs по дате отправления: