-
-
Save clarkritchie/44457ae036f8e58011df150a11e6fe18 to your computer and use it in GitHub Desktop.
Setup postgis in Amazon RDS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- taken from http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.html#Appendix.PostgreSQL.CommonDBATasks.PostGIS | |
create extension postgis; | |
create extension fuzzystrmatch; | |
create extension postgis_tiger_geocoder; | |
create extension postgis_topology; | |
alter schema tiger owner to rds_superuser; | |
alter schema topology owner to rds_superuser; | |
CREATE FUNCTION exec(text) returns text language plpgsql volatile AS $f$ BEGIN EXECUTE $1; RETURN $1; END; $f$; | |
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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment