-
-
Save lucasallan/1198957 to your computer and use it in GitHub Desktop.
Revisions
-
lucasallan revised this gist
Sep 11, 2011 . 1 changed file with 12 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,18 @@ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start createdb postgis_template createlang plpgsql postgis_template #If encountering errors like these: #createuser: could not connect to database postgres: could not connect to server: Permission denied # Is the server running locally and accepting # connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"? # #try: curl http://nextmarvel.net/blog/downloads/fixBrewLionPostgres.sh | sh # #more information: http://nextmarvel.net/blog/2011/09/brew-install-postgresql-on-os-x-lion/ #[Mac OSX] Import Postgis Data psql -d postgis_template -f /usr/local/Cellar/postgis/1.5.3/share/postgis/postgis.sql psql -d postgis_template -f /usr/local/Cellar/postgis/1.5.3/share/postgis/spatial_ref_sys.sql -
juniorz revised this gist
Jul 20, 2011 . 2 changed files with 52 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,29 +1,27 @@ # Some good references are: # http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x # http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/ # http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392 #1. Install PostgreSQL postgis and postgres brew install postgis initdb /usr/local/var/postgres pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start #2. Create a template to be used on creating GIS-enabled databases createdb postgis_template createlang plpgsql postgis_template #[Mac OSX] Import Postgis Data psql -d postgis_template -f /usr/local/Cellar/postgis/1.5.3/share/postgis/postgis.sql psql -d postgis_template -f /usr/local/Cellar/postgis/1.5.3/share/postgis/spatial_ref_sys.sql #Test if works psql -d postgis_template -c "SELECT postgis_full_version();" #3. Set template permissions to gisgroup createuser -R -S -L -D -I gisgroup; psql -d postgis_template @@ -33,13 +31,12 @@ ALTER TABLE spatial_ref_sys OWNER TO gisgroup; CREATE SCHEMA gis_schema AUTHORIZATION gisgroup; \q #4. Adds an app to your application createuser -i -l -S -R -d <app_user> psql -d postgres GRANT gisgroup TO <app_user>; \q #5. Create your app database createdb -T postgis_template -O <app_user> <app_db>; This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ # Some good references are: # http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x # http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/ # http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392 #1. Install PostgreSQL postgis and postgres sudo apt-get install postgresql-8.4 postgresql-client-8.4 postgresql-contrib-8.4 sudo apt-get install postgresql-8.4-postgis #2. Create a template to be used on creating GIS-enabled databases sudo su postgres createdb postgis_template createlang plpgsql postgis_template #Import Postgis Data psql -d postgis_template -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql psql -d postgis_template -f /usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql #Test if works psql -d postgis_template -c "SELECT postgis_full_version();" #3. Set template permissions to gisgroup createuser -R -S -L -D -I gisgroup; psql -d postgis_template ALTER DATABASE postgis_template OWNER TO gisgroup; ALTER TABLE geometry_columns OWNER TO gisgroup; ALTER TABLE spatial_ref_sys OWNER TO gisgroup; CREATE SCHEMA gis_schema AUTHORIZATION gisgroup; \q #4. Adds an app to your application createuser -i -l -S -R -d <app_user> psql -d postgres GRANT gisgroup TO <app_user>; \q #5. Create your app database createdb -T postgis_template -O <app_user> <app_db>; -
juniorz revised this gist
Jul 14, 2011 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -27,6 +27,7 @@ psql -d postgis_template -c "SELECT postgis_full_version();" createuser -R -S -L -D -I gisgroup; psql -d postgis_template ALTER DATABASE postgis_template OWNER TO gisgroup; ALTER TABLE geometry_columns OWNER TO gisgroup; ALTER TABLE spatial_ref_sys OWNER TO gisgroup; CREATE SCHEMA gis_schema AUTHORIZATION gisgroup; -
juniorz created this gist
Jul 14, 2011 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,44 @@ # Some good references are: # http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x # http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/ #Installs postgis and postgres brew install postgis #Do it only at first start initdb /usr/local/var/postgres #Starts the database manually pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start #Creates a template to be used on creating GIS-enabled databases createdb postgis_template createlang plpgsql postgis_template #Import Postgis Data psql -d postgis_template -f /usr/local/Cellar/postgis/1.5.3/share/postgis/postgis.sql psql -d postgis_template -f /usr/local/Cellar/postgis/1.5.3/share/postgis/spatial_ref_sys.sql #Test if works psql -d postgis_template -c "SELECT postgis_full_version();" #Permissions createuser -R -S -L -D -I gisgroup; psql -d postgis_template ALTER TABLE geometry_columns OWNER TO gisgroup; ALTER TABLE spatial_ref_sys OWNER TO gisgroup; CREATE SCHEMA gis_schema AUTHORIZATION gisgroup; \q #Adds an app user createuser -i -l -S -R -d <app_user> psql -d postgres GRANT gisgroup TO <app_user>; \q #Database creation createdb -T postgis_template -O <app_user> <app_db>