Koozali.org: home of the SME Server

How do I install postgreSQL 8+

Offline Peter120

  • 6
  • +0/-0
How do I install postgreSQL 8+
« on: August 21, 2007, 10:59:02 PM »
Hi,

I'd like to install postgreSQL on my sme 7.2 but I want to use version 8+, i.e as new as possible.

Is there any how to or if someone have any idea how I should go about it. I have searched the forum but cant find a clear description.

I would be grateful for any suggestions.

/Peter
« Last Edit: August 22, 2007, 12:01:52 AM by Peter120 »

Offline hedererjs

  • *
  • 33
  • +0/-0
    • http://www.asperience.fr
Re: How do I install postgreSQL 8+
« Reply #1 on: August 24, 2007, 11:17:01 PM »
I can provide you something in french if you want. Commands are the same...

Offline Peter120

  • 6
  • +0/-0
Re: How do I install postgreSQL 8+
« Reply #2 on: August 25, 2007, 10:39:21 PM »
Thanks,

I don't know any french but maybe the commands would be enough, I'd like to try.

/Peter

Offline kruhm

  • *
  • 680
  • +0/-0
Re: How do I install postgreSQL 8+
« Reply #3 on: August 28, 2007, 07:19:23 AM »
you could start with:

yum search postgre

Offline hedererjs

  • *
  • 33
  • +0/-0
    • http://www.asperience.fr
Re: How do I install postgreSQL 8+
« Reply #4 on: August 28, 2007, 09:32:29 AM »
yum --enablerepo centosplus install postgresql-jdbc.i386 postgresql-server.i386
/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

su - postgres
psql -d template1

alter user postgres with password 'xxxxx';
\q
exit

vi /etc/e-smith/templates-custom/var/lib/pgsql/data/postgresql.conf

superuser_reserved_connections=2
ssl = on
password_encryption = on
listen_addresses = '*'

cd /var/lib/pgsql/data
cp /etc/httpd/conf/ssl.crt/server.crt .
cp /etc/httpd/conf/ssl.key/server.key .
chown postgres:postgres server.*

vi /etc/e-smith/templates-custom/var/lib/pgsql/data/pg_hba.conf

à la fin du fichier, changer:

local   all         all                               ident sameuser

en:

local    all         all                               md5

changer:

host    all         all         127.0.0.1/32          ident sameuser

en

host    all         all         127.0.0.1/32          md5

changer:

host    all         all         ::1/128               ident sameuser

en:

host    all         all         ::1/128               md5


Ajouter (rejet du broadcast):

host    all         all         0.0.0.0 255.255.255.255  reject


Reporter les modifs:

expand-template /var/lib/pgsql/data/pg_hba.conf
expand-template /var/lib/pgsql/data/postgresql.conf

/etc/init.d/postgresql stop
/etc/init.d/postgresql start

Tests de fonctionnement:

createuser -S -R -D -U postgres jesuistest (sans droit de création de rôle)
psql -d postgrestest -U postgres
alter user jesuistest with password 'jesuistest';
\q

createdb -E UTF-8 -T template1 -O postgrestest -e -U postgres
exit
psql postgrestest -U jesuistest (mot de passe: 'jesuistest')
select * from pg_tables where tablename not like 'pg_%';
\q
dropdb postgrestest



ln -s /etc/init.d/postgresql /etc/rc.d/rc7.d/S56postgresql
ln -s /etc/init.d/postgresql /etc/rc.d/rc6.d/K03postgresql
signal-event post-upgrade
signal-event reboot



Offline kruhm

  • *
  • 680
  • +0/-0
Re: How do I install postgreSQL 8+
« Reply #5 on: August 28, 2007, 09:15:26 PM »
looks good to me
the packages are in the centos base repo. you don't have to enable the centosplus.

Offline hedererjs

  • *
  • 33
  • +0/-0
    • http://www.asperience.fr
Re: How do I install postgreSQL 8+
« Reply #6 on: August 29, 2007, 08:54:30 AM »
if I remember, packages in centos are those of version 7.4. packages in centosplus are 8.1 (that was like that 2 or 3 months ago)

Offline Peter120

  • 6
  • +0/-0
Re: How do I install postgreSQL 8+
« Reply #7 on: August 29, 2007, 11:52:47 AM »
Perfect, got 8.1.9 up and running now.  :grin:

Thanks

/Peter

Offline kruhm

  • *
  • 680
  • +0/-0
Re: How do I install postgreSQL 8+
« Reply #8 on: August 29, 2007, 02:48:54 PM »
learn something new everyday! Thanks hedererjs