Re: [PATCH] hstore_to_json: empty hstores must return empty json objects

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Oskari Saarenmaa <os(at)ohmu(dot)fi>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] hstore_to_json: empty hstores must return empty json objects
Date: 2013-10-17 13:19:59
Message-ID: CAHyXU0zWhtu+G0AaY71KOb7VrUeFtoJ+OexmLEGe+3HcVZO=bw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 17, 2013 at 7:20 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Wed, Oct 16, 2013 at 12:02 PM, Oskari Saarenmaa <os(at)ohmu(dot)fi> wrote:
>> hstore_to_json used to return an empty string for empty hstores, but
>> that is not correct as an empty string is not valid json and calling
>> row_to_json() on rows which have empty hstores will generate invalid
>> json for the entire row. The right thing to do is to return an empty
>> json object.
>
> Hmm. This sure looks like a bug to me.
>
> Anyone think otherwise?

It is a bug.

merlin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2013-10-17 13:20:23 Re: Unitialized Values in record_image_cmp
Previous Message Merlin Moncure 2013-10-17 13:16:58 Re: Unitialized Values in record_image_cmp