1. I apt-get installed Postgres 9.2.4 (using PPA).
  2. I used pg_dropcluster --stop 9.2 main to remove the default database cluster, because I intended on creating a new cluster on a separate SSD volume (a Rackspace block storage volume) that was just mounted.
  3. I created that new cluster whose data resides on my SSD volume and started it (ps shows all the normal Postgres processes running for that new cluster and I'm able to open a Postgres shell and run SQL - i.e., it's running fine). Now when I run pg_lsclusters there are none listed.

The main cluster listed just fine before I deleted it. Why won't my new cluster show up, even when it's running? I've even rebooted the server (just in case).

  • Well, how did you create the new cluster? Also, host OS and version? Ubuntu ... ? Debian ... ? Other? (Not many distros use pg_wrapper though) – Craig Ringer Jun 6 '13 at 3:51
  • @CraigRinger - I used initdb -D /the/dir/ - I think I just realized that I should have used pg_createcluster -d /the/dir/ shouldn't I have? Are they both the same, minus whatever extra meta data that Postgres stores about the cluster? (I'm on Ubuntu 12.04.2) – orokusaki Jun 6 '13 at 3:53
  • Wow, indeed that is the case - and what an awesome tool with such a simple syntax as pg_ctlcluster 9.2 mycluster start – orokusaki Jun 6 '13 at 3:59
  • Yep, you got it - if you want to use pg_wrapper you have to do so consistently. – Craig Ringer Jun 6 '13 at 4:10
  • @CraigRinger - thanks. If you put that into an answer (I made one, but it's not terrific), I'll accept yours and remove mine. – orokusaki Jun 6 '13 at 4:12

In order to use these postgres common tools with a cluster, they need to be used consistently. You would use pg_createcluster -d /path/to/data, instead of initdb. pg_createcluster adds the cluster to postgres-common in order to facilitate these handy operations. It is a wrapper, just like pg_ctlcluster, around the lower-level tools (e.g., initdb and pg_ctl), providing access from one place to operating on all of your clusters. It also has some defaults, such as an automatically configured log location based on the cluster name. this means you don't have to use -l /var/log/my-custom.log when you're creating or starting the server.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.