-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Support CSV delimiter other than comma #535
Comments
It may be only in your posting of an example here, but I think the quotation marks surrounding your x inside the JSONB are not properly escaped. On basically that very same note, I think first and foremost any CSV importing feature should implement RFC-compliant escaping (I don't know if PostgREST does it already), so your commas inside the quotation marks surrounding the entire JSONB would be properly ignored. Nevertheless, I don't object against the choice of arbitrary delimiters for both separation of columns and quoting; I would in fact also appreciate it for CSV output from PostgREST to be speicifiable, maybe through some Prefer header, unless possible in the Accept header. |
@SebAlbert could you provide me some small examples to test RFC compliance? I'll turn them into tests for the test suite. @rrantzau the ability to do the true COPY command depends on nikita-volkov/hasql#1. Also thinking about your specific example, maybe the |
Thank you for the replies, it was my mistake! The following example does work:
Great! |
Just some comments, they may or may not be of use: You may want to use the Accept header instead of the Content-type header in order to actually GET csv returned from the server. And you may want to use ?select=a,b,j instead of ?a,b,j |
I would like to populate a table that has a JSONB field and some non-JSONB fields using CSV format. I run into problems when the JSONB value in the CSV file has more than one key-value pair because I need to separate pairs with a comma.
Example line from CSV file:
foo,"{""a"": 1, ""b"": "x"}"
Is there a way to provide a parameter like in PostgreSQL's COPY command ("copy ... with delimiter '|'...")?
The text was updated successfully, but these errors were encountered: