-
Notifications
You must be signed in to change notification settings - Fork 67
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
datacopy CSV with null trailing columns not importing with -u #231
Comments
It seems odd that psql would accept the input file since the third column values are missing. Have you tried adding a |
The docks for the COPY STATEMENT which I fully acknowledge is distincy from the |
To track this down: Docs on
Docs on
So everything seems to depend on the Lines 69 to 70 in a96de39
copy_from . There, the separator is set to it's default , and passed to psycopg2's curs_copy_from . This adds a default value to NULL and constructs a COPY SQL command like COPY %s%s FROM stdin WITH DELIMITER AS %s NULL AS %s
To conclude: Remember the syntax of that
Ha! |
Thanks for the detailed trace, Tobias. Aside: your postgresql.org links use |
thanks, fixed. Obviously a lack of QA ;)
right. And that does change
actually - if I understand the code correctly - skipping pgdbconn would still not allow to specify 'CSV' as psycopg does not support this parameter at all. But it would be possible to pass an empty string for the 'null' parameter of it's |
Thanks Tobias for the clarification. I see now that |
Hello,
So no, there is no intention to support other parameters in The |
I have a csv of data as follows:
The this column is parentId, and its a self referencing foreign key:
If I run
yamltodb
without -u and copy the generated commands intopsql
\copy works fine
, If I do it with \u I getThe text was updated successfully, but these errors were encountered: