, ARRAY['psql', 'data_schema','staging_schema', 'staging_fold', 'website_root'],
ARRAY[platform.psql, variables.data_schema, variables.staging_schema, variables.staging_fold, variables.website_root])
AS shell_code
-FROM loader_variables As variables
- CROSS JOIN loader_platform As platform
+FROM tiger.loader_variables As variables
+ CROSS JOIN tiger.loader_platform As platform
WHERE platform.os = $1 -- generate script for selected platform
;
$BODY$
|| '_' || lu.table_name || '.dbf tiger_staging.' || lower(s.state_abbrev) || '_' || lu.table_name || ' | '::text || platform.psql
|| COALESCE(E'\n' ||
lu.post_load_process , '') , ARRAY['loader','table_name', 'lookup_name'], ARRAY[platform.loader, lu.table_name, lu.lookup_name ])
- FROM loader_lookuptables AS lu
+ FROM tiger.loader_lookuptables AS lu
WHERE level_state = true AND load = true
ORDER BY process_order, lookup_name), E'\n') ::text
-- County Level files
CROSS JOIN (SELECT name As state, abbrev As state_abbrev, lpad(st_code::text,2,'0') As state_fips,
lpad(st_code::text,2,'0') || '_'
|| replace(name, ' ', '_') As state_fold
-FROM state_lookup) As s CROSS JOIN loader_platform As platform
+FROM tiger.state_lookup) As s CROSS JOIN tiger.loader_platform As platform
WHERE $1 @> ARRAY[state_abbrev::text] -- If state is contained in list of states input generate script for it
AND platform.os = $2 -- generate script for selected platform
;