BUG #15756: Seemingly inconsistent behavior of SUBSTRING(string FROM pattern FOR escape) function
От | PG Bug reporting form |
---|---|
Тема | BUG #15756: Seemingly inconsistent behavior of SUBSTRING(string FROM pattern FOR escape) function |
Дата | |
Msg-id | 15756-27768253d60f7e38@postgresql.org обсуждение исходный текст |
Ответы |
Re: BUG #15756: Seemingly inconsistent behavior of SUBSTRING(stringFROM pattern FOR escape) function
Re: BUG #15756: Seemingly inconsistent behavior of SUBSTRING(stringFROM pattern FOR escape) function |
Список | pgsql-bugs |
The following bug has been logged on the website: Bug reference: 15756 Logged by: Sergei Abramov Email address: auspex@rambler.ru PostgreSQL version: 9.5.16 Operating system: Linux, Windows Description: When statement SELECT SUBSTRING('+380481234567' FROM 5 FOR 9), SUBSTRING('+380481234567' FROM '%#"[0-9]{9}#"' FOR '#') is issued in pgAdmin III Query both functions give the same correct results which are expected when psql command line tool is to be used: psql --username=postgres --no-password --command="SELECT SUBSTRING('+380481234567' FROM 5 FOR 9), SUBSTRING('+380481234567' FROM '%#"[0-9]{9}#"' FOR '#')" But here something strange occurs! The latter function invocation permanently returns NULL value that can be easily seen when wrapped in COALESCE: psql --username=postgres --no-password --command="SELECT COALESCE(SUBSTRING('+380481234567' FROM '%#"[0-9]{9}#"' FOR '#'), 'NULL')" This behavior is reproduced in Windows XP 32-bit, Windows 7 32-bit (both local PG-servers) and in Linux 64 bit (both local and remote PG-servers) for PG versions 9.3.23, 9.4.9, and 9.5.16. Thanks for your help!
В списке pgsql-bugs по дате отправления: