With this table
CREATE TABLE IF NOT EXISTS actions (
action_id UUID NOT NULL DEFAULT uuid_generate_v4(),
inputs JSONB[] NOT NULL DEFAULT ARRAY[]::JSONB[]
)
I'm trying to insert this data
INSERT INTO actions (
action_id,
inputs
)
VALUES (
'41fc94af-2f4e-424f-acde-641bb63f4b82',
array['{"type":"string"}{"displayName":"Base OAuth URL","type":"string","description":"Base OAuth URL"}']::jsonb[]
);
But getting the error
ERROR: invalid input syntax for type json
LINE 7: array['{"type":"string"}{"di...
^
DETAIL: Expected end of input, but found "{".
CONTEXT: JSON data, line 1: {"type":"string"}{...
This also doesn't work
INSERT INTO actions (
action_id,
inputs
)
VALUES (
'41fc94af-2f4e-424f-acde-641bb63f4b82',
[{"type":"string"}{"displayName":"Base OAuth URL","type":"string","description":"Base OAuth URL"}]::jsonb[]
);
arrayandjsonb. Do you really want a Postgresarrayofjsonbobjects or a JSON array of objects that is stored asjsonb?jsonb[], it's hard to index and confusing to deal withjsonb[]never makes sense in my opinion