Enabling Postgis - gecko-8/devwiki GitHub Wiki
Enable The Extensions
-
Execute the following commands one at a time
create extension postgis; create extension fuzzystrmatch; create extension postgis_tiger_geocoder; create extension postgis_topology;
-
Then these
alter schema tiger owner to rds_superuser; alter schema tiger_data owner to rds_superuser; alter schema topology owner to rds_superuser;
-
And then
CREATE FUNCTION exec(text) returns text language plpgsql volatile AS $f$ BEGIN EXECUTE $1; RETURN $1; END; $f$;
-
And finally execute this script
SELECT exec('ALTER TABLE ' || quote_ident(s.nspname) || '.' || quote_ident(s.relname) || ' OWNER TO rds_superuser;') FROM ( SELECT nspname, relname FROM pg_class c JOIN pg_namespace n ON (c.relnamespace = n.oid) WHERE nspname in ('tiger','topology') AND relkind IN ('r','S','v') ORDER BY relkind = 'S') s;
Confirm Everything is Working
-
Execute this script
SET search_path=public,tiger;
-
Then this one
select na.address, na.streetname, na.streettypeabbrev, na.zip from normalize_address('1 Devonshire Place, Boston, MA 02109') as na;
You should see the following
address | streetname | streettypeabbrev | zip ---------+------------+------------------+------- 1 | Devonshire | Pl | 02109
-
Execute this script
select topology.createtopology('my_new_topo',26986,0.5);
And you should see
createtopology ---------------- 1