guedes/pgvm

add `cluster` options to create more than one $PGDATA for the same version

Opened this issue · 2 comments

This allow you to have many data directories for the same PostgreSQL Installed Version

  • create Creates a new cluster (PGDATA)
  • remove Removes a cluster
  • rename Renames a cluster
  • list List all cluster
  • import Import a cluster from tarball
  • export Export a cluster to tarball

I'm thinking about we have a way to manage clusters without need to set 'pgvm use' first... we must put the PostgreSQL version at the beginning of cluster name to indicate which cluster we have do sometings without need to set 'pgvm use' first. I show below some samples:

$ pgvm list
PostgreSQL Installed Version:

PostgreSQL 8.2.23  [ ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV) ]
PostgreSQL 8.3.20  [ ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV) ]
PostgreSQL 8.4.13  [ ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV) ]
PostgreSQL 9.1.5   [ ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV) ]

=> PostgreSQL 9.2.0 [ ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV) ]

$ pgvm cluster list --all
8.2.23 main is online at port 5432
8.3.20 main is offline at port 5433
8.4.13 main is offline at port 5434
9.1.5 main is offline at port 5435

$ pgvm cluster start 8.3.20@test

Comments?

Please do it and send a pull request, 👍