row_to_json() Bug

Started by David E. Wheeleralmost 14 years ago4 messages
#1David E. Wheeler
david@justatheory.com

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

#2Andrew Dunstan
andrew@dunslane.net
In reply to: David E. Wheeler (#1)
Re: row_to_json() Bug

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

#3Andrew Dunstan
andrew@dunslane.net
In reply to: Andrew Dunstan (#2)
Re: row_to_json() Bug

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

#4David E. Wheeler
david@justatheory.com
In reply to: Andrew Dunstan (#3)
1 attachment(s)
Re: row_to_json() Bug

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

Attachments:

smime.p7sapplication/pkcs7-signature; name=smime.p7sDownload