Re: inconsistent behaviour of json_to_record and friends withembedded json - Mailing list pgsql-bugs

From Jeff Janes
Subject Re: inconsistent behaviour of json_to_record and friends withembedded json
Date
Msg-id CAMkU=1yjwaXTEDG3b-LC54s4y6BpmUsS8z-WvP8oA_ryukk8+w@mail.gmail.com
Whole thread Raw
In response to inconsistent behaviour of json_to_record and friends with embeddedjson  (Robert Vollmert <rob@vllmrt.net>)
Responses Re: inconsistent behaviour of json_to_record and friends withembedded json
Re: inconsistent behaviour of json_to_record and friends with embedded json
List pgsql-bugs
On Thu, May 30, 2019 at 10:41 AM Robert Vollmert <rob@vllmrt.net> wrote:

1. select * from json_to_record('{"out": "{\"key\": 1}"}') as (out json);
...
 
Postgres 10/11:

1. gives

ERROR:  invalid input syntax for type json
DETAIL:  Token "key" is invalid.
CONTEXT:  JSON data, line 1: "{“key…

This is caused by commit:

commit cf35346e813e5a1373f308d397bb0a8f3f21d530
Author: Andrew Dunstan <andrew@dunslane.net>
Date:   Thu Apr 6 22:11:21 2017 -0400

    Make json_populate_record and friends operate recursively
 

As far as I can tell, this was not an intended change, so I agree it is probably a bug.

Cheers,

Jeff

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #15827: Unable to connect on Windows using pg_services.conf using Python psycopg2
Next
From: Michael Paquier
Date:
Subject: Re: inconsistent behaviour of json_to_record and friends withembedded json