PostgreSQL tarkvara kasutamine Solarisega

Allikas: Kuutõrvaja
Redaktsioon seisuga 26. veebruar 2008, kell 17:31 kasutajalt Imre (arutelu | kaastöö)

Sissejuhatus

Ettevalmistuste tegemine

Tekitada operatsioonisüsteemi kasutaja:grupp postgres:postges kodukataloogiga /opt/postgres.

Valmistame ette ZFS failisüsteemid binari installi ning data cluster kataloogide jaoks

  • /usr/local - kuigi PostgreSQL ise hakkab asuma kataloogis /usr/local/postgresql, nagu allpool näeme paigutame lisamooduli Postgis kataloogi /usr/local/postgis ja mõnus on neid korraga käsitleda
  • /data/postgresql

Tarkvara paigaldamine

Kuigi PostgreSQL on olemas Solarise jaoks ka pakendatud kujul tegeleb käesolev tekst sellise juhtumiga kus andmebaas ning olulised lisamoodulid on paigaldatud lähtetekstist. Kasutame sellegs CSW paketihaldusega tulevat GNU C kompilaatorit (gcc).

Paigaldamiseks tuleb logida süsteemi sisse kasutajana postgres ning pakkida lahti PostgreSQLi lähtetekst

 bash$ mkdir 20080226 && cd 20080226
 bash$ wget ftp://ftp.eenet.ee/pub/postgresql/v8.3.0/postgresql-8.3.0.tar.bz2
 bash$ star jxf postgresql-8.3.0.tar.bz2

Seame keskkonnamuutujad

 bash$ export PATH=/usr/local/postgresql/bin:/opt/csw/bin:/opt/csw/gcc3/bin:/usr/sbin:\
 /usr/bin:/usr/dt/bin:/usr/sfw/bin:/usr/openwin/bin:/usr/ccs/bin
 bash$ export GCC=gcc
 bash$ unset CC
 bash$ unset CXX

Liigutame vanad asjad eest ära

 bash# mv /usr/local/postgresql /usr/local/postgresql-20060226-ennem-830-paigaldust
 bash# mv /data/postgresql /data/postgresql-20060226-ennem-830-paigaldust

Konfigureerimine, kompileerime ning paigaldame

 bash$ ./configure --with-perl --prefix=/usr/local/postgresql 1> ../configure.1.log 2>../configure.2.log
 bash$ gmake 1> ../gmake.1.log 2> ../gmake.2.log
 bash$ gmake install 1> ../gmake-install.1.log 2> ../gmake-install.2.log

Initsialiseerime andmebaasi

 bash$ /usr/local/postgresql/bin/initdb -E UNICODE --locale et_EE.UTF-8 -D /data/postgresql
 The files belonging to this database system will be owned by user "postgres".
 This user must also own the server process.
 
 The database cluster will be initialized with locale et_EE.UTF-8.
 initdb: could not find suitable text search configuration for locale et_EE.UTF-8
 The default text search configuration will be set to "simple".
 
 fixing permissions on existing directory /data/postgresql ... ok
 creating subdirectories ... ok
 selecting default max_connections ... 100
 selecting default shared_buffers/max_fsm_pages ... 32MB/204800
 creating configuration files ... ok
 creating template1 database in /data/postgresql/base/1 ... ok
 initializing pg_authid ... ok
 initializing dependencies ... ok
 creating system views ... ok
 loading system objects' descriptions ... ok
 creating conversions ... ok
 creating dictionaries ... ok
 setting privileges on built-in objects ... ok
 creating information schema ... ok
 vacuuming database template1 ... ok
 copying template1 to template0 ... ok
 copying template1 to postgres ... ok
 
 WARNING: enabling "trust" authentication for local connections
 You can change this by editing pg_hba.conf or using the -A option the
 next time you run initdb.
 
 Success. You can now start the database server using:
 
     /usr/local/postgresql/bin/postgres -D /data/postgresql
 or
     /usr/local/postgresql/bin/pg_ctl -D /data/postgresql -l logfile start

contrib moodulid

 bash$ cd contrib/fuzzystrmatch
 bash$ gmake
 bash$ gmake install


pljava paigaldamine

 bash$ star zxf pljava-src-1.4.0.tar.gz 
 bash$ export JAVA_HOME=/usr/java
 bash$ gmake 1>../pljava-gmake.1.log 2>../pljava-gmake.2.log
 bash$ gmake install 1>../pljava-gmake-install.1.log 2>../pljava-gmake-install.2.log

Postgis

http://geos.refractions.net/