Can I run Postgres 8.4 and Postgres 9 on the same computer?

Is it possible to run Postgres 8.4 and 9 (two installations) at the same time?

thanks

+7
source share
6 answers

Short answer: yes

Long answer:

You did not specify your OS, so it’s hard to say how to do this. For example, in Debian / Ubuntu, you can simply install the second version from the package ( postgresql-8.4 and postgresql-9.0 ), and everything works out of the box (thanks to postgresql-common ). On other systems, you may have to do this manually using low-level commands such as initdb and pg_ctl . Verify that the second installation (database cluster) is using a different port (for example, 5433) and not the same data directory.

+6
source

Yes, if the following three conditions are met:

  • PostgreSQL listens for a unique IP port (check pgbouncer , and you can hide both copies of PostgreSQL with a single IP port / port and reduce memory by reducing the number of active connections)
  • You have enough shared SYSV memory available (this is often the limiting factor)
  • You are using different PGDATA directories.

I can not recommend using pgbouncer enough.

+2
source

On Windows, you don’t have to do anything, since the installer automatically creates unique data directories and detects an existing installation and automatically configures ports.

For example, your first installation will listen on 5432, and the second installation will listen on 5433, as the installer configures this for you.

+2
source

You can always ask how difficult it will be to install two versions at the same time, and it depends on your operating system. For example, on RedHat Linux systems, this is very difficult to do. PostgreSQL RPMs are only for installing one version at any one time. Sometimes the only reasonable way is to create your own PostgreSQL from the original version for the second version that you want to install, which is an interesting adventure if you have never done it before.

In Debian Linux, two versions at once are pretty simple. I believe this is straightforward on Windows, but it depends on which installer you use.

Once you get two different versions of the database, only then you will have to worry about what everyone else is talking about: creating each database on its own port and its own installation directory. This is often trivial compared to the work required to install two versions at the same time.

+1
source

yes, you just put the data directories in different places.

0
source

Yes, you can. You will need to run them on different ports and use different data directories.

The ports and data directory can be set in postgresql.conf.

I find several other ways to specify a data directory, including using the PGDATA environment variable.

0
source

All Articles