Re: jsonb, unicode escapes and escaped backslashes

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Noah Misch <noah(at)leadboat(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: jsonb, unicode escapes and escaped backslashes
Date: 2015-01-29 17:10:58
Message-ID: CA+TgmoY5EtomS0JShnCccSkZL56tRwNyfmJ-KTJ0Sy4Cm7MWXg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 28, 2015 at 12:48 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> The cause of this bug is commit 0ad1a816320a2b539a51628e2a0b1e83ff096b1d,
> which I'm inclined to think we need to simply revert, not render even
> more squirrely.

Yes, that commit looks broken. If you convert from text to JSON you
should get a JSON string equivalent to the text you started out with.
That commit departs from that in favor of allowing \uXXXX sequences in
the text being converted to turn into a single character (or perhaps
an encoding error) after a text->json->text roundtrip. Maybe I
haven't had enough caffeine today, but I can't see how that can
possibly be a good idea.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2015-01-29 17:11:04 Re: pg_upgrade and rsync
Previous Message Andrew Dunstan 2015-01-29 17:09:58 Re: pg_upgrade and rsync