I'm having difficuly getting postgres running on RedHat 5.1 Linux. Below is a list of command sequences and the errors
beingreported.
Thanks for your help!
Erik
==================================================
[postgres@linny lib]$ whoami
postgres
[postgres@linny lib]$ pwd
/var/lib
[postgres@linny lib]$ postgres -D pgsql
---debug info---
Quiet = f
Noversion = f
timings = f
dates = Normal
bufsize = 64
sortmem = 512
query echo = f
DatabaseName = [postgres]
----------------
InitPostgres()..
FATAL 1: Database postgres does not exist in pg_database
FATAL 1: Database postgres does not exist in pg_database
======================
[postgres@linny pgsql]$ nohup postmaster > server.log 2>&1 &
[1] 1517
[postgres@linny pgsql]$ postgres -D pgsql
---debug info---
Quiet = f
Noversion = f
timings = f
dates = Normal
bufsize = 64
sortmem = 512
query echo = f
DatabaseName = [postgres]
----------------
InitPostgres()..
FATAL 1: Database system does not exist. PGDATA directory 'pgsql' not found.
Normally, you create a database system by running initdb.
FATAL 1: Database system does not exist. PGDATA directory 'pgsql' not found.
Normally, you create a database system by running initdb.
[1]+ Exit 2 nohup postmaster >server.log 2>&1
=====================
Try init db
[postgres@linny pgsql]$ initdb --pglib=/usr/lib --pgdata=/var/lib/pgsql
initdb: using /usr/lib/local1_template1.bki.source as input to create the templa
te database.
initdb: using /usr/lib/global1.bki.source as input to create the global classes.
initdb: using /usr/lib/pg_hba.conf.sample as the host-based authentication contr
ol file.
We are initializing the database system with username postgres (uid=100).
This user will own all the files and must also own the server process.
initdb: error: File /var/lib/pgsql/PG_VERSION already exists.
This probably means initdb has already been run and the
database system already exists.
If you want to create a new database system, either remove
the /var/lib/pgsql directory or run initdb with a --pgdata option
other than /var/lib/pgsql.
===============
init db in another directory
[postgres@linny pgsql]$ initdb --pglib=/usr/lib --pgdata=/var/lib/pgsql/data
initdb: using /usr/lib/local1_template1.bki.source as input to create the templa
te database.
initdb: using /usr/lib/global1.bki.source as input to create the global classes.
initdb: using /usr/lib/pg_hba.conf.sample as the host-based authentication contr
ol file.
We are initializing the database system with username postgres (uid=100).
This user will own all the files and must also own the server process.
Creating Postgres database system directory /var/lib/pgsql/data/base
initdb: creating template database in /var/lib/pgsql/data/base/template1
Running: postgres -boot -C -F -D/var/lib/pgsql/data -Q template1
Creating global classes in /base
Running: postgres -boot -C -F -D/var/lib/pgsql/data -Q template1
Adding template1 database to pg_database...
Running: postgres -boot -C -F -D/var/lib/pgsql/data -Q template1 < /tmp/create.1
550
vacuuming template1
creating public pg_user view
loading pg_description
=======================
start postmaster and check server.log
[postgres@linny pgsql]$ nohup postmaster -D /var/lib/pgsql/data > server.log 2>
[1] 1609
[postgres@linny pgsql]$ cat server.log
FATAL: StreamServerPort: bind() failed: errno=98
Is another postmaster already running on that port?
If not, remove socket node (/tmp/.s.PGSQL.<portnr>)and retry.
postmaster: cannot create UNIX stream port
[1]+ Exit 1 nohup postmaster -D /var/lib/pgsql/data >server.lo
g 2>&1
=====================
remove socket node
[postgres@linny pgsql]$ rm /tmp/.s.PGSQL.5432
=======================
restart postmaster and try psql and postgres
[postgres@linny pgsql]$ rm /tmp/.s.PGSQL.5432
[postgres@linny pgsql]$ rm server.log
<stmaster -D /var/lib/pgsql/data > server.log 2>&1 &
[1] 1615
[postgres@linny pgsql]$ cat server.log
[postgres@linny pgsql]$ psql
Connection to database 'postgres' failed.
FATAL 1: Database postgres does not exist in pg_database
[postgres@linny pgsql]$ postgres -D /var/lib/pgsql/data
---debug info---
Quiet = f
Noversion = f
timings = f
dates = Normal
bufsize = 64
sortmem = 512
query echo = f
DatabaseName = [postgres]
----------------
InitPostgres()..
FATAL 1: Database postgres does not exist in pg_database
FATAL 1: Database postgres does not exist in pg_database
[postgres@linny pgsql]$ postgres -D /var/lib/pgsql/data ALL
---debug info---
Quiet = f
Noversion = f
timings = f
dates = Normal
bufsize = 64
sortmem = 512
query echo = f
DatabaseName = [ALL]
----------------
InitPostgres()..
FATAL 1: Database ALL does not exist in pg_database
FATAL 1: Database ALL does not exist in pg_database