Skip to content

Instantly share code, notes, and snippets.

@damienvancouver
Created June 9, 2015 20:01
Show Gist options
  • Save damienvancouver/1a44844bc170a783162c to your computer and use it in GitHub Desktop.
Save damienvancouver/1a44844bc170a783162c to your computer and use it in GitHub Desktop.
PostGIS 1 / PostGRES 8 installation
sudo su postgres
createuser -l -W fortmckay
# Shall the new role be a superuser? (y/n) n
# Shall the new role be allowed to create databases? (y/n) n
# Shall the new role be allowed to create more new roles? (y/n) n
# Password: <type the user password>
createdb fortmckay --o fortmckay
createlang plpgsql -d fortmckay
psql fortmckay -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql
psql fortmckay -f /usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql
Then set some stuff in sql with:
psql fortmckay
# grant privilege on standard ogc tables to user
grant all on geometry_columns to fortmckay;
grant select on spatial_ref_sys to fortmckay;
alter role fortmckay with password '<password>'; # for some reason we have to set this again in psql before it works
Finally, test that you can connect with:
psql -h 127.0.0.1 -U fortmckay fortmckay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment