0

I search how to import json data in table postgresql with the command copy this is a picture of my json file.

[{"csgn":{},"err":["no error"],"num":"884","name":{},"mail":null},{"csgn"....

enter image description here

COPY tbl_import_test_json (csgn,err, num, name, mail) from '/tmp/FILOUT.json' delimiter ',';

This command doesn't work, i have a problem to extract field err.

Thanks for your answer.

smiss
  • 63
  • 1
  • 8
  • Have you made any attempts, read the documentation or at least googled your question? – Georgi Raychev Oct 04 '18 at 06:04
  • I think this can help you: [enter link description here](https://stackoverflow.com/questions/39224382/how-can-i-import-a-json-file-into-postgresql) – Shay.R Oct 04 '18 at 06:05
  • Possible duplicate of [How can I import a JSON file into PostgreSQL?](https://stackoverflow.com/questions/39224382/how-can-i-import-a-json-file-into-postgresql) – Georgi Raychev Oct 04 '18 at 06:05
  • 1
    the command into this post doesn't works. this is why i post my question. This post doesn't cleary explan how to extract from a file. – smiss Oct 04 '18 at 06:31
  • Can you please add sample json instead of screen shot? What error(s) did you get? – Yavuz Selim Oct 04 '18 at 06:40
  • the error is: missing data for column err – smiss Oct 04 '18 at 08:36

0 Answers0