BUG #13936: jsonb_object() -> ERROR: unknown type of jsonb container - Mailing list pgsql-bugs

From xtracoder@gmail.com
Subject BUG #13936: jsonb_object() -> ERROR: unknown type of jsonb container
Date
Msg-id 20160208195207.2647.46863@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #13936: jsonb_object() -> ERROR: unknown type of jsonb container
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      13936
Logged by:          Xtra Coder
Email address:      xtracoder@gmail.com
PostgreSQL version: 9.5.0
Operating system:   Windows7
Description:

I'm getting absolutely misleading error message when trying to build a JSON
object from empty resultset.

Here is the simple code to reproduce:

    select jsonb_object('{}'::text[], '{}'::text[])

Result of execution is

    ERROR:  unknown type of jsonb container
    ********** Error **********

    ERROR: unknown type of jsonb container
    SQL state: XX000

Expected result - jsonb object with no attributes, i.e.: '{}'

pgsql-bugs by date:

Previous
From: dv@unlimitedsoftware.it
Date:
Subject: BUG #13917: "upsert" construct doesn't work with partial index
Next
From: tarasbob@gmail.com
Date:
Subject: BUG #13918: Simple query with Having clause returns incorrect results