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

Error \copy csv file size greater than 500MB #322

Open
lessdantu opened this issue Mar 26, 2022 · 2 comments
Open

Error \copy csv file size greater than 500MB #322

lessdantu opened this issue Mar 26, 2022 · 2 comments

Comments

@lessdantu
Copy link

if agrclaimsystemlog.csv size is less than 500MB, the data can be uploaded successfully, otherwise the upload will fail, display 'killed'.

usql postgres://admin:@127.0.0.1:5432/jquerydb?sslmode=disable <<EOF
\copy csv://. postgres://admin:@127.0.0.1:5432/jquerydb?sslmode=disable 'select * from agrclaimsystemlog' 'update_pkvalue'
EOF

Connected with driver postgres (PostgreSQL 9.4.26)

@nineinchnick
Copy link
Member

For such huge files, I'd recommend using native PostgreSQL tools, which should have better performance anyway. PostgreSQL supports copying from CSV files:

COPY update_pkvalue FROM '/path/to/csv/agrclaimsystemlog.csv' WITH (FORMAT csv);

@davidfetter
Copy link

For such huge files, I'd recommend using native PostgreSQL tools, which should have better performance anyway. PostgreSQL supports copying from CSV files:

COPY update_pkvalue FROM '/path/to/csv/agrclaimsystemlog.csv' WITH (FORMAT csv);

That works exactly and only when the csv file is on the same machine as the DB, so kiss it goodbye unless you have a shell on that DB box, which is to say all the cloud-based forks of PostgreSQL and probably a lot of others, seeing as people avoid, for very good reason, giving out shell access to all and sundry on DB machines.

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

3 participants