|
Programming -
Open Source Database
|
|
PostGresql Installation
- Make sure you "make clean" if you ran into any problem before starting a fresh installation
- Get the source code of PostGresql by clicking here
- Unzip the postgresql source files
- Change the folder by using command cd <folder where the zip file is uncompressed>
- configure --prefix=<Folder of the installation Folder where you want your postgresql to be installed> --with-libxml
- make
- make check
- export LD_LIBRARY_PATH=<the installation folder>/lib
- <installation Folder>/bin/initdb -D <installation Folder>/data
- <installation Folder>/bin/postmaster -D <installation Folder>/data for verbose run
OR
<installation Folder>/bin/pg_ctl -D <installation Folder>/data -l /tmp/pgsql.log start for silent run
PostGis Installation
- Install Goes and PROJ dependencies.
- Make sure the postgresql is installed and ready to accept connection
- configure --with-geosconfig=<Path to folder where you have installed Geos library>/bin/geos-config --with-projdir=<Path to Folder where you have installed Proj library>
- make check
- if you get error like
ERROR: function postgis_lib_version() does not exist LINE 1: select postgis_lib_version() then Copy files in <path to folder wher Proj library is installed>/lib/ to the lib folder of postgresql Installation
- make install
Create a spatially enabled database:
go to the in folder of Postgresql installation a) createdb [yourdatabase]
b) createlang plpgsql [yourdatabase]
c) psql -d [yourdatabase] -f postgis.sql d) psql -d [yourdatabase] -f spatial_ref_sys.sql if you get error like files postgis.sql or spatial_ref_sys.sql not found: give the complete path <postgresql installation folder>/share/contrib/postgis-1.5/
|