add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Help with an interesting Postgres question: Why isn't an Index Only Scan used on a partition accessed via the parent table?.
ERROR:  invalid input syntax for type json
LINE 1: select '{1:"abc"}'::jsonb;
               ^
DETAIL:  Expected string or "}", but found "1".
CONTEXT:  JSON data, line 1: {1...
SELECT 2
jsonb_object_agg
{"1": {"id": 1, "name": "John"}, "2": {"id": 2, "name": "Jane"}}
{"1": {"id": 1, "name": "John"}, "2": {"id": 2, "name": "Ted"}, "11": {"id": 11, "name": "Jane"}, "111": {"id": 111, "name": "Bob"}}
SELECT 2
jsonb_object_agg
{"1": {"id": 1, "name": "John"}, "2": {"id": 2, "name": "Jane"}}
{"1": {"id": 1, "name": "John"}, "2": {"id": 11, "name": "Jane"}, "3": {"id": 111, "name": "Bob"}, "4": {"id": 2, "name": "Ted"}}
SELECT 2
jsonb_pretty
{
    "1": {
        "id": 1,
        "name": "John"
    },
    "2": {
        "id": 2,
        "name": "Jane"
    }
}
{
    "1": {
        "id": 1,
        "name": "John"
    },
    "2": {
        "id": 2,
        "name": "Ted"
    },
    "11": {
        "id": 11,
        "name": "Jane"
    },
    "111": {
        "id": 111,
        "name": "Bob"
    }
}
UPDATE 2