Currently using postgresql in pgAdmin 4 to import some csvs into my tables – I’ve never done this before but none of the jsonb columns are – for reference, this is just data I’ve been sent to practice with.
To try to get to the bottom of this, I’ve created a table test with columns ‘id’ [type = uuid] and ‘testjson’ [type = jsonb].
ERROR: invalid input syntax for type json
DETAIL: Token "thiskey" is invalid.
CONTEXT: JSON data, line 1: {thiskey...
COPY test2, line 2, column properties: " {thiskey:thisvalue}"
My raw data in the csv looks like (cut down to one line to make simpler):
id,testjson
00552b94-7b13-491e-83d1-6cbebe1b7613, "{""thiskey"":""thisvalue""}"
and I have the options selected as shown in the settings.
(https://i.sstatic.net/mUeSOeDs.png)
Every time I hit “ok” on import, I get the following error:
I know there are other questions on stackoverflow addressing this error but they all seem to be doing it once the data is successfully imported, which is a hurdle I am failing to overcome.
MC2k is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.