Skip site navigation (1) Skip section navigation (2)

Re: row_to_json() Bug

From: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
To: pgsql-hackers Hackers <pgsql-hackers(at)postgreSQL(dot)org>
Subject: row_to_json() Bug
Date: 2012-02-24 01:35:09
Message-ID: 1B70BD5A-B70A-471B-8AF5-371FFE2647D3@justatheory.com (view raw)
Looks like row_to_json() thinks 0s are nulls:

    postgres=# select row(0);
     row 
    -----
     (0)
    (1 row)

    postgres=# SELECT row_to_json(row(0));
     row_to_json 
    -------------
     {"f1":null}
    (1 row)

Best,

David


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
Cc: pgsql-hackers Hackers <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: row_to_json() Bug
Date: 2012-02-24 02:09:21
Message-ID: 4F46F151.1030303@dunslane.net (view raw)

On 02/23/2012 08:35 PM, David E. Wheeler wrote:
> Looks like row_to_json() thinks 0s are nulls:
>
>      postgres=# select row(0);
>       row
>      -----
>       (0)
>      (1 row)
>
>      postgres=# SELECT row_to_json(row(0));
>       row_to_json
>      -------------
>       {"f1":null}
>      (1 row)
>


Yeah, ouch, will fix.

cheers

andrew

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
Cc: pgsql-hackers Hackers <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: row_to_json() Bug
Date: 2012-02-24 04:49:19
Message-ID: 4F4716CF.6070402@dunslane.net (view raw)

On 02/23/2012 09:09 PM, Andrew Dunstan wrote:
>
>
> On 02/23/2012 08:35 PM, David E. Wheeler wrote:
>> Looks like row_to_json() thinks 0s are nulls:
>>
>>      postgres=# select row(0);
>>       row
>>      -----
>>       (0)
>>      (1 row)
>>
>>      postgres=# SELECT row_to_json(row(0));
>>       row_to_json
>>      -------------
>>       {"f1":null}
>>      (1 row)
>>
>
>
> Yeah, ouch, will fix.
>
>

Fixed, Thanks for the report. (Also fixed in my 9.1 backport).

cheers

andrew

From: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers Hackers <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: row_to_json() Bug
Date: 2012-02-24 04:54:49
Message-ID: 425513EC-CF49-430C-8EEE-E16A524633A0@justatheory.com (view raw)
On Feb 23, 2012, at 8:49 PM, Andrew Dunstan wrote:

> Fixed, Thanks for the report. (Also fixed in my 9.1 backport).

Awesome, thanks, will try it tomorrow.

David


Privacy Policy | About PostgreSQL
Copyright © 1996-2013 The PostgreSQL Global Development Group