Created
October 5, 2012 20:01
-
-
Save adamfast/3842023 to your computer and use it in GitHub Desktop.
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
def create_spatial_database_template(): | |
sudo("""createdb -E UTF8 template_postgis -U postgres""") | |
try: | |
sudo("""createlang -d template_postgis plpgsql -U postgres""") | |
except: | |
pass | |
sudo("""psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql -U postgres""") | |
sudo("""psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql -U postgres""") | |
sudo("""psql -d template_postgis -c "GRANT ALL ON geometry_columns TO PUBLIC;" -U postgres""") | |
sudo("""psql -d template_postgis -c "GRANT ALL ON spatial_ref_sys TO PUBLIC;" -U postgres""") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment