Hi
I followed the instructions at
http://wiki.contribs.org/Postgres in order to get a recent version of
PostgreSQL up and running on my 7.2 box (P2 350, 512MB RAM, 40GB HD).
I started off with the first command from the wiki:
rpm -q --whatrequires perl-CGI-Session perl-DBD-Pg
and then
yum remove perl-CGI-Session perl-DBD-Pg
which went smoothly.
I then enabled the centosplus repository and installed postgres:
yum --enablerepo=centosplus install postgresql postgresql-contrib postgresql-devel postgresql-docs postgresql-pl postgresql-python postgresql-test
which also seemed to go nicely, but note the dovecot warning (in red)
---> Downloading header for tcl to pack into transaction set.
tcl-8.4.7-2.i386.rpm 100% |=========================| 24 kB 00:00
---> Package tcl.i386 0:8.4.7-2 set to be updated
---> Downloading header for postgresql-libs to pack into transaction set.
postgresql-libs-8.1.9-1.e 100% |=========================| 15 kB 00:00
---> Package postgresql-libs.i386 0:8.1.9-1.el4s1.1 set to be updated
---> Downloading header for mx to pack into transaction set.
mx-2.0.5-3.i386.rpm 100% |=========================| 36 kB 00:00
---> Package mx.i386 0:2.0.5-3 set to be updated
--> Running transaction check
--> Processing Dependency: libpq.so.3 for package: dovecot
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for dovecot to pack into transaction set.
ftp://ftp.planetmirror.com/pub/smeserver/releases/7/smeos/i386/SME/RPMS/dovecot-1.0-1.2.rc15.el4.sme.i386.rpm: [Errno 4] IOError: [Errno ftp error] 550 smeserver: Connection timed out
Trying other mirror.
dovecot-1.0-1.2.rc15.el4. 100% |=========================| 26 kB 00:00
---> Package dovecot.i386 0:1.0-1.2.rc15.el4.sme set to be updated
--> Running transaction check
--> Processing Dependency: libpq.so.3 for package: dovecot
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for postgresqlclient7 to pack into transaction set.
postgresqlclient7-7.4.17- 100% |=========================| 6.5 kB 00:00
---> Package postgresqlclient7.i386 0:7.4.17-1.el4s1.1 set to be updated
--> Running transaction check
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
postgresql i386 8.1.9-1.el4s1.1 centosplus 2.7 M
postgresql-contrib i386 8.1.9-1.el4s1.1 centosplus 414 k
postgresql-devel i386 8.1.9-1.el4s1.1 centosplus 1.1 M
postgresql-docs i386 8.1.9-1.el4s1.1 centosplus 5.6 M
postgresql-pl i386 8.1.9-1.el4s1.1 centosplus 66 k
postgresql-python i386 8.1.9-1.el4s1.1 centosplus 63 k
postgresql-test i386 8.1.9-1.el4s1.1 centosplus 1.1 M
Installing for dependencies:
mx i386 2.0.5-3 base 569 k
postgresql-server i386 8.1.9-1.el4s1.1 centosplus 3.8 M
postgresqlclient7 i386 7.4.17-1.el4s1.1 centosplus 235 k
tcl i386 8.4.7-2 base 897 k
Updating for dependencies:
dovecot i386 1.0-1.2.rc15.el4.sme smeos 1.3 M
postgresql-libs i386 8.1.9-1.el4s1.1 centosplus 183 k
Transaction Summary
=============================================================================
Install 11 Package(s)
Update 2 Package(s)
Remove 0 Package(s)
Total download size: 18 M
Is this ok [y/N]: y
Downloading Packages:
(1/13): postgresql-server 100% |=========================| 3.8 MB 00:04
(2/13): postgresql-pl-8.1 100% |=========================| 66 kB 00:00
(3/13): postgresqlclient7 100% |=========================| 235 kB 00:00
(4/13): dovecot-1.0-1.2.r 100% |=========================| 1.3 MB 00:01
(5/13): postgresql-test-8 100% |=========================| 1.1 MB 00:01
(6/13): tcl-8.4.7-2.i386. 100% |=========================| 897 kB 00:00
(7/13): postgresql-contri 100% |=========================| 414 kB 00:00
(8/13): postgresql-python 100% |=========================| 63 kB 00:00
(9/13): postgresql-libs-8 100% |=========================| 183 kB 00:00
(10/13): mx-2.0.5-3.i386. 100% |=========================| 569 kB 00:00
(11/13): postgresql-8.1.9 100% |=========================| 2.7 MB 00:02
(12/13): postgresql-docs- 100% |=========================| 5.6 MB 00:06
(13/13): postgresql-devel 100% |=========================| 1.1 MB 00:01
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
smeserver trap pre-install: postgresql-server
smeserver trap pre-install: postgresql-pl
smeserver trap pre-install: postgresqlclient7
smeserver trap pre-install: dovecot
smeserver trap pre-install: postgresql-test
smeserver trap pre-install: tcl
smeserver trap pre-install: postgresql-contrib
smeserver trap pre-install: postgresql-python
smeserver trap pre-install: postgresql-libs
smeserver trap pre-install: mx
smeserver trap pre-install: postgresql
smeserver trap pre-install: postgresql-docs
smeserver trap pre-install: postgresql-devel
Updating : postgresql-libs ####################### [ 1/15]
Installing: postgresql ####################### [ 2/15]
Installing: postgresqlclient7 ####################### [ 3/15]
Installing: postgresql-server ####################### [ 4/15]
Installing: mx ####################### [ 5/15]
Installing: tcl ####################### [ 6/15]
Installing: postgresql-pl ####################### [ 7/15]
Updating : dovecot [ 8/15]warning: /etc/dovecot.conf created as /etc/dovecot.conf.rpmnew
Updating : dovecot ####################### [ 8/15]
Installing: postgresql-test ####################### [ 9/15]
Installing: postgresql-contrib ####################### [10/15]
Installing: postgresql-python ####################### [11/15]
Installing: postgresql-docs ####################### [12/15]
Installing: postgresql-devel ####################### [13/15]
Cleanup : dovecot ####################### [14/15]
Cleanup : postgresql-libs ####################### [15/15]
Migrating existing database yum_repositories
Migrating existing database yum_installed
Migrating existing database hosts
Migrating existing database yum_available
Migrating existing database accounts
Migrating existing database configuration
Migrating existing database mailpatterns
Migrating existing database backups
Migrating existing database networks
Migrating existing database domains
Migrating existing database yum_updates
Migrating existing database spamassassin
smeserver trap post-install: postgresql-server
smeserver trap post-install: postgresql-pl
smeserver trap post-install: postgresqlclient7
smeserver trap post-install: dovecot
smeserver trap post-install: postgresql-test
smeserver trap post-install: tcl
smeserver trap post-install: postgresql-contrib
smeserver trap post-install: postgresql-python
smeserver trap post-install: postgresql-libs
smeserver trap post-install: mx
smeserver trap post-install: postgresql
smeserver trap post-install: postgresql-docs
smeserver trap post-install: postgresql-devel
Installed: postgresql.i386 0:8.1.9-1.el4s1.1 postgresql-contrib.i386 0:8.1.9-1.el4s1.1 postgresql-devel.i386 0:8.1.9-1.el4s1.1 postgresql-docs.i386 0:8.1.9-1.el4s1.1 postgresql-pl.i386 0:8.1.9-1.el4s1.1 postgresql-python.i386 0:8.1.9-1.el4s1.1 postgresql-test.i386 0:8.1.9-1.el4s1.1
Dependency Installed: mx.i386 0:2.0.5-3 postgresql-server.i386 0:8.1.9-1.el4s1.1 postgresqlclient7.i386 0:7.4.17-1.el4s1.1 tcl.i386 0:8.4.7-2
Dependency Updated: dovecot.i386 0:1.0-1.2.rc15.el4.sme postgresql-libs.i386 0:8.1.9-1.el4s1.1
Complete!
==============================================================
WARNING: You now need to run BOTH of the following commands
to ensure consistent system state:
signal-event post-upgrade; signal-event reboot
You should run these commands unless you are certain that
yum made no changes to your system.
==============================================================
I signalled the post-upgrade event, and rebooted.
Then started the postgresql server:
[root@www ~]# /etc/init.d/postgresql start
Initializing database: [ OK ]
Starting postgresql service: [ OK ]
and followed the instructions to make the necessary custom templates:
[root@www ~]# mkdir -p /etc/e-smith/templates/var/lib/pgsql/data
[root@www ~]# mkdir -p /etc/e-smith/templates-custom/var/lib/pgsql/data
[root@www ~]# cp /var/lib/pgsql/data/postgresql.conf /etc/e-smith/templates/var/lib/pgsql/data
[root@www ~]# cp /var/lib/pgsql/data/pg_hba.conf /etc/e-smith/templates/var/lib/pgsql/data
[root@www ~]# cp /var/lib/pgsql/data/postgresql.conf /etc/e-smith/templates-custom/var/lib/pgsql/data
[root@www ~]# cp /var/lib/pgsql/data/pg_hba.conf /etc/e-smith/templates-custom/var/lib/pgsql/data
I then logged as postgres user:
[root@www ~]# su postgres
and had a go at the next series of commands, but
bash-3.00$ psql -U postgres -d template1
gave me
could not change directory to "/root"
Welcome to psql 8.1.9, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
which looks suspiciously like it didn't work properly but I went for it anyway:
template1=# alter user postgres with encrypted password 'verysecretpassword';
ALTER ROLE
template1=# \q
bash-3.00$ exit
I made the rest of the changes as per the wiki, but after rebooting and trying to access postgres with the new password:
[root@www data]# su postgres
I get
bash-3.00$ psql -U postgres -d template1
psql: FATAL: missing or erroneous pg_hba.conf file
HINT: See server log for details.
So, I have a few questions.
1) Where does psql keep its log files? (Nothing obvious in /var/log)
2) Why does it kick up a "
missing or erroneous pg_hba.conf file"?
3) What's with the dovecot error, and why is my webmail now showing 0 messages?
Any help on this would be much appreciated.
TIA
Pete