Discussion:
[BUGS] jsonb_array_elements issue
(too old to reply)
mephysto
2016-08-05 13:39:12 UTC
Permalink
Hi there,
I found an issue in jsonb_array_elements that can be a bug. I am using
PostgreSQL 9.5.3.

With this JSON:




If I try to execute



I get this error: ERROR: unknown type of jsonb container


Instead, If I use json_array_elements with the same argument, I get no
errors:



return this result:



Moreover it is strange that jsob function run without errors if I execute it
with internal JSON as parameter:



returns correct JSON.


Is it an error genrate by myself or is it a bug indeed?

Thanks in advance.

Meph



--
View this message in context: http://postgresql.nabble.com/jsonb-array-elements-issue-tp5915026.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.
--
Sent via pgsql-bugs mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
David G. Johnston
2016-08-05 14:42:22 UTC
Permalink
Post by mephysto
Hi there,
I found an issue in jsonb_array_elements that can be a bug. I am using
PostgreSQL 9.5.3.
​Nabble generates emails that these lists do not properly accept - all of
your json and queries got stripped out.

Anyway, the queries you provided gave me "function not found errors".

I did get the following to work just fine though...

select jsonb_array_elements(
((
'{"skillId":58,"applicationConditionId":1,"skillName":"[{\"id\":1,\"text\":\"Armatura\"},{\"id\":2,\"text\":\"Armor\"}]","skillDescription":"[{\"id\":1,\"text\":\"Riduce
ATK DMG ricevuto dalla Carta Personaggio di
#[$$X$$]#\"},{\"id\":2,\"text\":\"Reduce ATK DMG dealt to Character Card by
#[$$X$$]#\"}]","affectsData":[{"activationTime":1000,"affectId":0,"affectTarget":1,"affectTrigger":2,"afterOrBeforeTriggeringAction":1,"effectData":{"effectFormula":"1*$$X$$","effectId":73,"effectTarget":1,"timeSchedule":""},"timesToTrigger":-1}],"effectsData":[]}'::JSONB
)->>'affectsData'
)::jsonb)

David J.
​

Loading...