-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Postgres : backslash seems removed in json during COPY resulting in "invalid input syntax for type json" #202
Comments
It is correctly handled by read_csv:
|
Same issue if we try to insert in Postgres:
|
Hi @anayrat, did you encounter this error while using the postgres extension? |
Yes, I forgot to mention that. I created and loaded the extension. Then attached postgres database. |
https://www.postgresql.org/docs/current/sql-copy.html
|
Thanks! This issue may be better suited to the Postgres repository, so I transferred it there for the time being. |
Fix #202 - correctly escape backslashes in Postgres text copy
I see that this bug is marked as closed, but what version of DuckDB contains the fix? With 0.10.2 I still have this issue. |
@LMnet try upgrading the postgres client by issuing |
@szarnyasg thank you, these steps helped. |
What happens?
There is a problem how DuckDB handle
\
.Here is the table in Postgres :
Here is the corresponding csv with header :
If I try to COPY from this CSV to Postgres, I get this error :
As you can notice, the
\
has been removed and the JSON is invalid.Any idea how to solve this issue ?
Thanks
To Reproduce
Create this table in Postgres :
Try to copy this csv:
OS:
Linux
DuckDB Version:
v0.10.1
DuckDB Client:
CLI
Full Name:
Adrien Nayrat
Affiliation:
Self Employed
Have you tried this on the latest nightly build?
I have tested with a release build (and could not test with a nightly build)
Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?
The text was updated successfully, but these errors were encountered: