Getting COPY For Bulk CSV Working on a Container Running PostgreSQL

id,country,ip,created_at,updated_at,project_id
4cf25606-5f3e-4575-86ea-c585513fcc39,Solomon Islands,169.137.96.151,2020-12-25T05:04:26.124Z,2020-12-30T11:04:26.124Z,d6ef3dfd-9596-4391-b0ef-3d7a8a1a6d10
cbeaf6ab-23cc-43c5-a740-7191f59d8cc5,Solomon Islands,106.92.223.22,2020-12-25T05:04:26.124Z,2020-12-30T11:04:26.124Z,d6ef3dfd-9596-4391-b0ef-3d7a8a1a6d10
17a7ec0b-2758-4721-b104-f368c8109b6a,Solomon Islands,248.8.206.229,2020-12-25T05:04:26.124Z,2020-12-30T11:04:26.124Z,d6ef3dfd-9596-4391-b0ef-3d7a8a1a6d10
docker cp ./name_of_file.csv pgdb:/name_of_file.csv
COPY the_table_where_the_data_will_go FROM '/name_of_file.csv' CSV HEADER;

--

--

--

Software dev, data, heavy metal, transit, economics, freethought, atheism, cycling, livability, beautiful things & adrenaline junkie.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

[Dagger 2] — Custom Scopes

Elastic Jupyter Notebooks on Kubernetes: the Cloud Native Way

Wildcard Operator and Nongreedy Subrules

Ansible — Tips

My Journey of Building a Trading Application— Chapter Seventeen

FizzBoom benchmark (call for participation)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adron Hall

Adron Hall

Software dev, data, heavy metal, transit, economics, freethought, atheism, cycling, livability, beautiful things & adrenaline junkie.

More from Medium

Playing with Variadic Columns

Covering unit-tests running in sub-processes/threads on GitHub Actions using coverage.py

Streaming MongoExport to Blob Store (S3)

How we made our integration tests delightful by optimizing our GitHub Actions workflow