Re: [PATCH] Generalized JSON output functions - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: [PATCH] Generalized JSON output functions
Date
Msg-id 55A93157.4060708@dunslane.net
Whole thread Raw
In response to Re: [PATCH] Generalized JSON output functions  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: [PATCH] Generalized JSON output functions
List pgsql-hackers
On 07/17/2015 10:30 AM, Alvaro Herrera wrote:
> Andrew Dunstan wrote:
>
>> I have already pointed out how this patch is fundamentally broken. You can
>> achieve your aims by a fairly small amount of code inside your logical
>> decoder, and with no core code changes whatsoever. So I'm puzzled why we are
>> even still debating this broken design.
> I went through all your responses over the entire thread and I couldn't
> find your argument about how this is fundamentally broken.  Can you
> restate, or maybe give an archive link if I just missed it?
>
>
> (Saying "but it changes so much of the existing code" is not really a
> fundamental problem to me.  I mean, it's not like the existing code is
> perfect and needs no changes.)
>


On July 13 I wrote:

> Yes, but I think the plugin is the right place to do it. What is more, 
> this won't actually prevent you completely from producing 
> non-ECMAScript compliant JSON, since json or jsonb values containing 
> offending numerics won't be caught, AIUI. But a fairly simple to write 
> function that reparsed and fixed the JSON inside the decoder would work.

The OP admitted that this was a serious flaw in his approach. In fact, 
given that a json value can contain an offending numeric value, any 
approach which doesn't involve reparsing is pretty much bound to fail.

cheers

andrew



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [PATCH] Generalized JSON output functions
Next
From: Robert Haas
Date:
Subject: Re: Transactions involving multiple postgres foreign servers