Skip to content
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

Can not insert a CSV with an array column #10

Open
iglesu opened this issue Nov 4, 2022 · 1 comment
Open

Can not insert a CSV with an array column #10

iglesu opened this issue Nov 4, 2022 · 1 comment

Comments

@iglesu
Copy link
Contributor

iglesu commented Nov 4, 2022

It seems having the same delimiter for columns and the elements of the array confuses the Postgres copy command.
One solution I found was to set the delimiter to something else, e.g. | and leave the delimiter for the array to be comma separated.

@iglesu
Copy link
Contributor Author

iglesu commented Nov 4, 2022

A better solution is to simply quote the array:
E.g.
COPY mydb_3195.test_qm_import_fits (targetid,targetcode,fluxarray) FROM stdin CSV DELIMITER ',';
19722,ABCD,"{{24.82,5.42},{0.10,14.04}}"
75828,ABC,"{{514.06,60.03},{82.43,19.31}}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant