Postico
Postico copied to clipboard
Importing CSV from a Postico CSV export keeps failing
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.
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:
- try to import only the first half of rows
- if 1. fails, the error is there. So repeat step 1. with only the first half
- if 1. does not fail, try to import the other half
- 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
I'm also getting this problem, it seems to be happening with large JSONB data.
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: can you share the problematic file and the failing statement so I can try to fix the issue? Please email it to [email protected]