User Tools

Site Tools


postgres:copy_command

This is an old revision of the document!


europa.csv

<code> world=# create table membership_raw (State text, GNI text, wage text, UN text, CoE text, OSCE text, EU text, EEA text, CU text, Schengen text, euro text, OECD text, WTO text, ESA text, NATO text, ICC text, VWP text);

world=# \encoding latin1

world=# copy membership_raw from '/home/mh/world/europa.csv' delimiter ';';

world=# select count(code2) from countries where name in (select state from membership_raw); count


world=# insert into countries_x_organisations (code, organisation_id) world-# select code, (select id from organisations where name = 'EU') from countries where name in (select state from membership_raw where eu = 'EU');

postgres/copy_command.1374863408.txt.gz · Last modified: 2014/09/10 21:22 (external edit)