You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm on OSX 10.14, go version 1.11.5, installed pgfutter from source. I'm unable to import JSON into Postgres (tried with Postgres versions 9.4 and 10.6). When I try importing a test file with 4 objects in JSON Lines format, pgfutter says 1 row was imported successfully and 3 failed:
pgfutter --ignore-errors --jsonb json test
0 B / 53 B [------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 0.00%
{"foo":"bar"}
{"banana":3}
{"apple":[4]}
53 B / 53 B [====================================================================================================================================================================================================================] 100.00% 0s
Looking in the db table, no rows were created.
I've fallen back to importing via COPY reading from stdin:
# HACK: COPY, when running in text mode, unescapes backslashes, which renders JSON that contains that escape character invalid. So we need to prevent
# COPY from doing that. To do so, we use csv mode plus QUOTE and DELIMITER characters that are prohibited by JSON spec.
# Cf. https://stackoverflow.com/a/52355439, http://adpgtech.blogspot.com/2014/09/importing-json-data.html
< $file psql -h localhost -p 5432 mydb -c "COPY ingest (data) FROM STDIN csv quote e'\x01' delimiter e'\x02';"
The text was updated successfully, but these errors were encountered:
I'm on OSX 10.14, go version 1.11.5, installed pgfutter from source. I'm unable to import JSON into Postgres (tried with Postgres versions 9.4 and 10.6). When I try importing a test file with 4 objects in JSON Lines format, pgfutter says 1 row was imported successfully and 3 failed:
Looking in the db table, no rows were created.
I've fallen back to importing via
COPY
reading from stdin:The text was updated successfully, but these errors were encountered: