Import CSV file from internet in postgres
Posted at 2021-09-02

Import CSV file from internet in postgres


CREATE TABLE film_locations
 (title text ,
 release_year integer ,
 locations text ,
 fun_facts text ,
 production_company text ,
 distributor text ,
 director text ,
 writer text ,
 actor_1 text ,
 actor_2 text ,
 actor_3 text );

COPY film_locations
 FROM PROGRAM 'wget -q -O - "$@" "https://data.sfgov.org/api/views/yitu-d5am/rows.csv?accessType=DOWNLOAD"'
 HEADER CSV DELIMITER ',';
		

Comments 0

Post a Comment