Pregunta

I am looking to create a new database cluster in PostgreSQL because I want this cluster to point to a different (and larger) data directory than my current cluster on localhost:5432. To create a new cluster, I ran the command below. However, after restarting PostgresSQL I don't see the db cluster in pgAdmin and can't connect to a server with port 5435. How do I connect to this new cluster? Alternatively, I thought I could create a new tablespace within the old cluster which points to this larger data directory, but I'm assuming that populating a database using this tablespace would still result in files being written to the cluster data directory? I'm running PostgreSQL 9.3 on Ubuntu 12.4.

$ pg_createcluster -d /home/foo 9.3 test_env

Creating new cluster 9.3/test_env ...
  config /etc/postgresql/9.3/test_env
  data   /home/foo/
  locale en_US.UTF-8
  port   5435
¿Fue útil?

Solución

You need to specify option '--start' if you want it to actually start the database. Without that it will just create the data directory.

However using table spaces would probably be a better solution since running multiple database clusters introduces the overhead of running completely separate postmaster processes. If you create a database in a table space then all files associated with the database will go in the associated directory. The system catalogue will still be in the cluster's data directory, but this is unlikely to be large enough to cause you any problems.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top