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;

--

--

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.