[BUGS] BUG #14688: Wrong results in LIKE operation on JSON Type - Mailing list pgsql-bugs

From nblxa@mail.ru
Subject [BUGS] BUG #14688: Wrong results in LIKE operation on JSON Type
Date
Msg-id 20170605071822.1453.53540@wrigleys.postgresql.org
Whole thread Raw
Responses Re: [BUGS] BUG #14688: Wrong results in LIKE operation on JSON Type  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      14688
Logged by:          Ilya Kopylov
Email address:      nblxa@mail.ru
PostgreSQL version: 9.6.0
Operating system:   Windows 8.1
Description:

When JSON contains '\\' symbol, then operator '=' works well, but operator
'LIKE' return wrong result.

SELECT '{"Name":"Domen\\Ivan"}'::json ->> 'Name' = 'Domen\Ivan'; -- yields
true

SELECT '{"Name":"Domen\\Ivan"}'::json ->> 'Name' LIKE 'Domen\Ivan'; --
yields false

SELECT '{"Name":"Domen\\Ivan"}'::json ->> 'Name' LIKE 'Domen\\Ivan'; --
yields true

When I search with 'LIKE' operator and adding '\' symbol, when got result. I
think whis is bug.


--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Andres Freund
Date:
Subject: Re: [BUGS] BUG #14687: pg_xlogdump does only count "main data" forrecord length and leading to incorrect statistics
Next
From: Heikki Linnakangas
Date:
Subject: Re: [BUGS] BUG #14687: pg_xlogdump does only count "main data" forrecord length and leading to incorrect statistics