SELECT loader_generate_script(ARRAY['CA'], 'sh') AS result; #--------------------------------------- ## set vars BASEDIR=/black1/pgis22_geocoder_test TMPDIR=${BASEDIR}"/temp/" UNZIPTOOL=unzip WGETTOOL="/usr/bin/wget" export PGBIN=/usr/lib/postgresql/9.4/bin export PGPORT=5433 export PGHOST=localhost export PGUSER=dbb export PGPASSWORD=xxxxxxxxxxx export PGDATABASE=addr_test_94 PSQL=${PGBIN}/psql SHP2PGSQL=${PGBIN}/shp2pgsql cd ${BASEDIR} ... replace wget / ${WGETTOOL} regularize ${BASEDIR} , ${TMPDIR} small indent fixes ... run script ... ##--- ##- count result records ------ ca_addr 2934938 ca_bg 23212 ca_cousub 397 ca_edges 3923238 ca_faces 1133110 ca_featnames 4526071 ca_place 1516 ca_tabblock 0 ca_tract 8057 ca_zcta5 1769 ca_zip_lookup_base 0 ca_zip_state 2214 ca_zip_state_loc 4861 ##----- ## search for 'ERROR' in output ## inflating: /black1/pgis22_geocoder_test/temp/tl_2014_06_place.shx unzip: cannot find or open */tl_*_06*_place.zip, */tl_*_06*_place.zip.zip or */tl_*_06*_place.zip.ZIP. No zipfiles found. ERROR: relation "ca_place" already exists Shapefile type: Polygon Postgis type: MULTIPOLYGON[2] .... NOTICE: INSERT INTO tiger_data.ca_place(statefp,placefp,placens,plcidfp,name,namelsad,lsad,classfp,pcicbsa,pcinecta,mtfcc,funcstat,aland,awater,intptlat,intptlon,the_geom) SELECT statefp,placefp,placens,plcidfp,name,namelsad,lsad,classfp,pcicbsa,pcinecta,mtfcc,funcstat,aland,awater,intptlat,intptlon,the_geom FROM tiger_staging.ca_place; CONTEXT: SQL function "loader_load_staged_data" statement 1 ERROR: duplicate key value violates unique constraint "pk_ca_place" DETAIL: Key (plcidfp)=(0666140) already exists. CONTEXT: SQL statement "INSERT INTO tiger_data.ca_place(statefp,placefp,placens,plcidfp,name,namelsad,lsad,classfp,pcicbsa,pcinecta,mtfcc,funcstat,aland,awater,intptlat,intptlon,the_geom) SELECT statefp,placefp,placens,plcidfp,name,namelsad,lsad,classfp,pcicbsa,pcinecta,mtfcc,funcstat,aland,awater,intptlat,intptlon,the_geom FROM tiger_staging.ca_place;" PL/pgSQL function loader_load_staged_data(text,text,text[]) line 24 at EXECUTE statement SQL function "loader_load_staged_data" statement 1 ERROR: relation "idx_ca_place_soundex_name" already exists ERROR: relation "tiger_data_ca_place_the_geom_gist" already exists ERROR: constraint "chk_statefp" for relation "ca_place" already exists --2014-10-18 23:33:24-- ftp://ftp2.census.gov/geo/tiger/TIGER2014/COUSUB/tl_*_06_* => ‘ftp2.census.gov/geo/tiger/TIGER2014/COUSUB/.listing’ ... No zipfiles found. CREATE TABLE Unable to open tl_2014_06_tabblock.shp or tl_2014_06_tabblock.SHP. tl_2014_06_tabblock.dbf: dbf file (.dbf) can not be opened. ERROR: relation "tiger_staging.ca_tabblock" does not exist ALTER TABLE CREATE INDEX VACUUM .... inflating: /black1/pgis22_geocoder_test/temp/tl_2014_06_place.shx unzip: cannot find or open */tl_*_06*_place.zip, */tl_*_06*_place.zip.zip or */tl_*_06*_place.zip.ZIP. No zipfiles found. ERROR: relation "ca_place" already exists Shapefile type: Polygon Postgis type: MULTIPOLYGON[2] SET SET ... NOTICE: INSERT INTO tiger_data.ca_place(statefp,placefp,placens,plcidfp,name,namelsad,lsad,classfp,pcicbsa,pcinecta,mtfcc,funcstat,aland,awater,intptlat,intptlon,the_geom) SELECT statefp,placefp,placens,plcidfp,name,namelsad,lsad,classfp,pcicbsa,pcinecta,mtfcc,funcstat,aland,awater,intptlat,intptlon,the_geom FROM tiger_staging.ca_place; CONTEXT: SQL function "loader_load_staged_data" statement 1 ERROR: duplicate key value violates unique constraint "pk_ca_place" DETAIL: Key (plcidfp)=(0666140) already exists. CONTEXT: SQL statement "INSERT INTO tiger_data.ca_place(statefp,placefp,placens,plcidfp,name,namelsad,lsad,classfp,pcicbsa,pcinecta,mtfcc,funcstat,aland,awater,intptlat,intptlon,the_geom) SELECT statefp,placefp,placens,plcidfp,name,namelsad,lsad,classfp,pcicbsa,pcinecta,mtfcc,funcstat,aland,awater,intptlat,intptlon,the_geom FROM tiger_staging.ca_place;" PL/pgSQL function loader_load_staged_data(text,text,text[]) line 24 at EXECUTE statement ... SQL function "loader_load_staged_data" statement 1 ERROR: relation "idx_ca_place_soundex_name" already exists ERROR: relation "tiger_data_ca_place_the_geom_gist" already exists ERROR: constraint "chk_statefp" for relation "ca_place" already exists --2014-10-18 23:33:24-- ftp://ftp2.census.gov/geo/tiger/TIGER2014/COUSUB/tl_*_06_* => ‘ftp2.census.gov/geo/tiger/TIGER2014/COUSUB/.listing’ Resolving ftp2.census.gov (ftp2.census.gov)... 148.129.75.35, 2610:20:2010:a09:1000:0:9481:4b23 ... No zipfiles found. CREATE TABLE Unable to open tl_2014_06_tabblock.shp or tl_2014_06_tabblock.SHP. tl_2014_06_tabblock.dbf: dbf file (.dbf) can not be opened. ERROR: relation "tiger_staging.ca_tabblock" does not exist ALTER TABLE CREATE INDEX VACUUM ...