Google Grupper har inte längre stöd för nya Usenet-inlägg eller -prenumerationer. Historiskt innehåll förblir synligt.
Dismiss

[BUGS] jsonb_array_elements issue

3 visningar
Hoppa till det första olästa meddelandet

mephysto

oläst,
5 aug. 2016 09:39:222016-08-05
till
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

oläst,
5 aug. 2016 10:43:162016-08-05
till
On Fri, Aug 5, 2016 at 9:39 AM, mephysto <mephyst...@gmail.com> wrote:
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.
 

0 nya meddelanden