Changes between Version 55 and Version 56 of GeoDjangoInstall


Ignore:
Timestamp:
08/16/2008 04:31:56 PM (7 years ago)
Author:
springmeyer
Comment:

More PostgreSQL/PostGIS notes

Legend:

Unmodified
Added
Removed
Modified
  • GeoDjangoInstall

    v55 v56  
    123123Next, create a role and database for your application, and allow it to access PostGIS functionality.
    124124
    125 Start by switching into the `postgres user`
     125Start by switching into the `postgres user`(see below about db initialization if you don't have a postgres user)
    126126{{{
    127127# su - postgres
     
    131131$ createuser <user>
    132132}}}
    133 If you get any error see http://www.postgresql.org/docs/8.3/interactive/tutorial-createdb.html
     133 * Note: if you have not initialized the postgres db cluster (if you used apt-get to install postgresql this was already done) do this:
     134 {{{
     135sudo adduser postgres
     136# run through interactive prompt
     137sudo su - postgres
     138mkdir /path/to/postgres/data
     139chmod -R 700 /path/to/postgres/data
     140initdb -D /path/to/postgres/data
     141pg_ctl start -D /path/to/postgres/data
     142}}}
     143If you get any errors see http://www.postgresql.org/docs/8.3/interactive/tutorial-createdb.html
     144
     145Now, create the database with your chosen user:
    134146{{{
    135147$ createdb -O <user> <db_name>
    136148$ createlang plpgsql <db_name>
    137149}}}
     150
    138151Now, load the postgis sql functions and spatial_ref_table of projection information.
    139 Note: PostGIS SQL files are ''ususally'' installed in the PostgreSQL share directory (`/usr/postgres/8.2/share` in the example below; use the `pg_config --sharedir` command to determine this directory on your system, which can vary widely depending on your PostgreSQL version and install method as well as how you install postgis, ie from source or with apt-get).
     152
     153Note: PostGIS SQL files are ''ususally'' installed in the PostgreSQL share directory (`/usr/postgres/8.2/share` in the example below). Use the `pg_config --sharedir` command to determine this directory on your system, which can vary widely depending on your PostgreSQL version and install method.
     154
     155In addition, depending on your install method for postgis the sql files may be in another location like `/usr/share'.
     156
    140157{{{
    141158$ psql -d <db_name> -f /usr/postgres/8.2/share/lwpostgis.sql # check your PostgreSQL Version, 8.x
Back to Top