Postgres Fixes
Example:
DEBUG: Invalid primary checkPoint record
DEBUG: open(logfile 1 seg 153) failed: No such file or directory
DEBUG: Invalid secondary checkPoint record
FATAL 2: Unable to locate a valid CheckPoint record
/usr/bin/postmaster: Startup proc 3956 exited with status 512 abort
Fix:
!!This is a destructive fix only to logfilewhich in and of itself is dangerous because there might be unfinished transactions, but if you need to get at the data this is the only way I know of.
cd /usr/lib/pgsql/contrib/pg_resetxlog/
pg_resetxlog -f /var/lib/pgsql/data/
Example:
/usr/bin/postmaster: The number of buffers (-B) must be at least twice the number of allowed connections (-N) and at least 16.
Fix:
this is a problems with postgres installed from the SUSE 7.3 disks just view /etc/rc.d/postgresql and change this line variables N & B defaults were 32 and 128 I quadrupled them to be safe these may have to go higher in the future.
Line: /sbin/startproc -e -t 1 -u postgres -l $LOGFILE $H $OPTIONS -N128 -B512 -D$DATADIR
Example:
FATAL 1: Database "template1" does not exist in the system catalog. OR
psql: FATAL 1: Database "template1" does not exist in the system catalog.
createdb: database creation failed
Fix:
initdb -D /var/lib/pgsql
!! This is destructive if you have to do this it means that something went terribly wrong you are starting over when you do this.
Example:
In a new install no one can connect to the database except localhost.
Fix:
Edit /var/lib/pgsql/data/pg_hba.conf
This is the Postgresql Host Access Control File
One is part of the default configuration you can leave as is
Two add this line right below line one.
Note: This is a very liberal configuration this would not be good for a server sitting exposed to the internet but for use on our local intranet it works good.
1.host all 127.0.0.1 255.255.255.255 trust
2.host all 192.1.1.0 255.255.255.0 trust
Misc Tips:
- In a new/reinstall make sure /var/lib/pgsql & /usr/local/pgsql are empty this will save many headaches.
- Pay attention to the log /var/log/postgresql this is very informative if you are having trouble.<.li>
- groups.google.com is a great place to search for error messages.