function jsonb_pretty only outputs first character of result

Started by Martin Jonssonalmost 9 years ago2 messagesbugs
Jump to latest
#1Martin Jonsson
martinerikjonsson@yahoo.fr

Hello.

On postgres 9.6.3 (current ubuntu release) using the jsonb_pretty function as in the documentation:

"select jsonb_pretty('[{"f1":1,"f2":null},2,null,3]')" does only give output "[". it seems the function only outputs the first character.

Many thanks

Martin Jonsson

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Martin Jonsson (#1)
Re: function jsonb_pretty only outputs first character of result

Martin Jonsson <martinerikjonsson@yahoo.fr> writes:

On postgres 9.6.3 (current ubuntu release) using the jsonb_pretty function as in the documentation:
"select jsonb_pretty('[{"f1":1,"f2":null},2,null,3]')" does only give output "[". it seems the function only outputs the first character.

Hm, I get:

regression=# select jsonb_pretty('[{"f1":1,"f2":null},2,null,3]');
jsonb_pretty
--------------------
[ +
{ +
"f1": 1, +
"f2": null+
}, +
2, +
null, +
3 +
]
(1 row)

Perhaps you were testing it with something that only showed you the first
line of the result text?

regards, tom lane

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs