Procedure:
- As root, shut down the PostgreSQL server.
# systemctl stop postgresql.service
 - Become the postgres user.
# su - postgres
 - Copy the 
pg_hba.conffile to postgres home directory so I can restore it later.
postgres$ cp data/pg_hba.conf .
 - Wipe the 
/var/lib/pgsql/data/directory.
postgres$ rm -rf /var/lib/pgsql/data/
 - Become root again.
postgres$ exit
 - Start the server again - it will detect that the 
/var/lib/pgsql/data/directory is missing and re-create it.
# systemctl start postgresql.service
 - Become the postgres user.
# su - postgres
 - Resore the 
pg_hba.conffile todata/
postgres$ cp pg_hba.conf data/
 - Become root again.
postgres$ exit
 - Restart the server to load the production 
pg_hba.confsettings.
# systemctl restart postgresql.service
 
No comments:
Post a Comment