Showing posts with label PGDATA. Show all posts
Showing posts with label PGDATA. Show all posts

Friday, October 03, 2008

How to change postgresql data directory

How to change postgresql data directory.
  1. vim /etc/postgresql/8.2/main/postgresql.conf
  2. set data directory path to the new directory path
  3. Create new Server Certificate
    1. openssl req -new -text -out server.req
    2. openssl rsa -in privkey.pem -out server.key
    3. rm privkey.pem
    4. openssl req -x509 -in server.req -text -key server.key -out server.crt
    5. chmod og-rwx server.key
    6. chown postgres:postgres server.key
  4. Stop and Restart Postgresql server
References:
  1. http://developer.postgresql.org/pgdocs/postgres/ssl-tcp.html
  2. http://www.linuxquestions.org/questions/linux-server-73/change-postgresql-data-directory-649911/
  3. http://www.postgresql.org/docs/8.3/static/runtime-config-file-locations.html