<code>create table test (jsonarraycolumn jsonb[]);
insert into test values (array['{"a": 45.50, "b": 10}', '{"a": 70.50, "b": 80}']);
</code>
<code>create table test (jsonarraycolumn jsonb[]);
insert into test values (array['{"a": 45.50, "b": 10}', '{"a": 70.50, "b": 80}']);
</code>
create table test (jsonarraycolumn jsonb[]);
insert into test values (array['{"a": 45.50, "b": 10}', '{"a": 70.50, "b": 80}']);
I have created a table ‘test’.
Trying to insert an array of json:
1st json:
‘{“a”: 45.50, “b”: 10}’
2nd json:
‘{“a”: 70.50, “b”: 80}’
I am getting the error:
<code>SQL Error [42804]: ERROR: column "jsonarraycolumn" is of type jsonb[] but expression is of type text[]
Hint: You will need to rewrite or cast the expression.
Position: 26
</code>
<code>SQL Error [42804]: ERROR: column "jsonarraycolumn" is of type jsonb[] but expression is of type text[]
Hint: You will need to rewrite or cast the expression.
Position: 26
</code>
SQL Error [42804]: ERROR: column "jsonarraycolumn" is of type jsonb[] but expression is of type text[]
Hint: You will need to rewrite or cast the expression.
Position: 26
How is an array of json inserted into a postgresql column?