Difference between revisions of "Postgresql"

From SME Server
Jump to navigationJump to search
(New page: == How to install Postgres 8 == This howto are created with information extracted from forums. Proceed at your own risk. Work for me. Enable centosplus repository and install postgres (...)
 
Line 1: Line 1:
 
 
== How to install Postgres 8 ==
 
== How to install Postgres 8 ==
  
This howto are created with information extracted from forums. Proceed at your own risk. Work for me.
+
{{Note box|This howto are created with information extracted from forums. Proceed at your own risk. Work for me.}}
  
 
Enable centosplus repository and install postgres (at the time writen this howto is 8.1.9 version)
 
Enable centosplus repository and install postgres (at the time writen this howto is 8.1.9 version)
Line 8: Line 7:
 
  yum --enablerepo=centosplus install postgresql postgresql-contrib postgresql-devel postgresql-docs postgresql-pl postgresql-python postgresql-test
 
  yum --enablerepo=centosplus install postgresql postgresql-contrib postgresql-devel postgresql-docs postgresql-pl postgresql-python postgresql-test
  
The above command install postgres and update postgres-libs, and install for dependency tcl and mx from base repository. If you see other packages, such as perl or php, abort the installation now!. This ocur because maybe you have installed perl-CGI-Session or perl-DBD-Pg. These two packages are in your system because you have installed otrs oe other aplication. In my case I have remove these two packages (because I not need otrs), and run again the installation.
+
{{Warning box|The above command install '''postgres''' and update '''postgres-libs''', and install for dependency '''tcl''' and '''mx''' from '''base''' repository. If you see other packages, such as '''perl''' or '''php''', '''abort the installation now!'''. This occur because maybe you have installed '''perl-CGI-Session''' or '''perl-DBD-Pg'''. These two packages are in your system because you have installed '''otrs''' or another aplication. In my case I have remove these two packages (because I not need '''otrs''' any more), and run again the installation.}}
  
The make the necesary custom templates:
+
Then make the necesary custom templates:
  
 
  /etc/init.d/postgresql start
 
  /etc/init.d/postgresql start
Line 19: Line 18:
 
  cp /var/lib/pgsql/data/postgresql.conf /etc/e-smith/templates-custom/var/lib/pgsql/data
 
  cp /var/lib/pgsql/data/postgresql.conf /etc/e-smith/templates-custom/var/lib/pgsql/data
 
  cp /var/lib/pgsql/data/pg_hba.conf /etc/e-smith/templates-custom/var/lib/pgsql/data
 
  cp /var/lib/pgsql/data/pg_hba.conf /etc/e-smith/templates-custom/var/lib/pgsql/data
 +
 +
 +
Now login as postgres user:
 +
 +
su postgres
 +
 +
Then access to superuser database, set a password and exit.
 +
 +
psql -U postgres -d template1
 +
alter user postgres with encrypted password 'xxxxx';
 +
\q
 +
exit

Revision as of 08:43, 4 November 2007

How to install Postgres 8

Important.png Note:
This howto are created with information extracted from forums. Proceed at your own risk. Work for me.


Enable centosplus repository and install postgres (at the time writen this howto is 8.1.9 version)

yum --enablerepo=centosplus install postgresql postgresql-contrib postgresql-devel postgresql-docs postgresql-pl postgresql-python postgresql-test


Warning.png Warning:
The above command install postgres and update postgres-libs, and install for dependency tcl and mx from base repository. If you see other packages, such as perl or php, abort the installation now!. This occur because maybe you have installed perl-CGI-Session or perl-DBD-Pg. These two packages are in your system because you have installed otrs or another aplication. In my case I have remove these two packages (because I not need otrs any more), and run again the installation.


Then make the necesary custom templates:

/etc/init.d/postgresql start
mkdir -p /etc/e-smith/templates/var/lib/pgsql/data
mkdir -p /etc/e-smith/templates-custom/var/lib/pgsql/data
cp /var/lib/pgsql/data/postgresql.conf /etc/e-smith/templates/var/lib/pgsql/data
cp /var/lib/pgsql/data/pg_hba.conf /etc/e-smith/templates/var/lib/pgsql/data
cp /var/lib/pgsql/data/postgresql.conf /etc/e-smith/templates-custom/var/lib/pgsql/data
cp /var/lib/pgsql/data/pg_hba.conf /etc/e-smith/templates-custom/var/lib/pgsql/data


Now login as postgres user:

su postgres

Then access to superuser database, set a password and exit.

psql -U postgres -d template1
alter user postgres with encrypted password 'xxxxx';
\q
exit