Postico icon indicating copy to clipboard operation
Postico copied to clipboard

Importing CSV from a Postico CSV export keeps failing

Open petealbertson opened this issue 3 years ago • 4 comments

What did you do?

  • Exported a table from a production db to csv via Postico
  • In a different local development db, I attempted to import the same csv into the same table

What did you expect to happen?

  • I expected to see the table import successfully.

What actually happened?

  • I received an error 'PostgreSQL said: syntax error at or near ";"' and the import failed.'

What software versions are you using?

Postico version:
1.5.19 (previously used and tried 1.5.8, same result)

macOS version:
Big sur 11.6

PostgreSQL version:
11.6

Context: I also tried validating the csv file using some online validators and didn't find any issues. It's quite a large csv file so searching for a syntax error is not feasible.

petealbertson avatar Nov 03 '21 22:11 petealbertson

Hey @petealbertson, thanks for reporting this CSV export/import issue.

I'm afraid it's hard to say without the data.

Guess not, but any chance to share the file with us for debugging purposes?

Otherwise, any chance you could bisect the CSV to isolate the problem? Like, doing a binary search for the problem:

  1. try to import only the first half of rows
  2. if 1. fails, the error is there. So repeat step 1. with only the first half
  3. if 1. does not fail, try to import the other half
  4. if 3. fails, the error is there. So repeat step 1. with the failing half

This should yield a minimum set of lines with trigger the issue.

Best regards, Martin

martinjankoehler avatar Nov 09 '21 13:11 martinjankoehler

I'm also getting this problem, it seems to be happening with large JSONB data.

luizfilipe avatar Sep 22 '22 15:09 luizfilipe

Got a very similar problem, I am sure the issue is not in the data it self since I just cropped the data to a single row to explore the error, using the Postgres's logs is very useful, it will show you a clear copy of the failing statement so you can find the exact cause of the issue, on MacOS you can find the file logs on /opt/homebrew/var/log/postgres.log , hope this helps!

0xjorgev avatar Apr 15 '24 10:04 0xjorgev

0xjorgev: can you share the problematic file and the failing statement so I can try to fix the issue? Please email it to [email protected]

jakob avatar Apr 15 '24 10:04 jakob