Forum OpenACS Q&A: Response to How can I recover a pg_control file?

Collapse
Posted by Dan Wickstrom on
I don't think initdb is your problem since it won't run if the PGDATA is not empty:

1090 nsadmin@localhost:~/sourceforge/openfts >initdb
This database system will be initialized with username "nsadmin".
This user will own all the data files and must also own the server process.
 
initdb: The directory /usr/local/pgsql/data exists but is not empty.
If you want to create a new database system, either remove or empty
the directory /usr/local/pgsql/data or run initdb with
an argument other than /usr/local/pgsql/data.
1091 nsadmin@localhost:~/sourceforge/openfts >psql openacs4
Welcome to psql, the PostgreSQL interactive terminal.
 
Type:  copyright for distribution terms
       h for help with SQL commands
       ? for help on internal slash commands
       g or terminate with semicolon to execute query
       q to quit
 
openacs4=# select version();
                               version
---------------------------------------------------------------------
 PostgreSQL 7.1.1 on i686-pc-linux-gnu, compiled by GCC egcs-2.91.66
(1 row)
 
openacs4=#   

As you can see, initdb won't do anything unless you have already nuked your PGDATA directory.