How To Run Multiple Instances Of PostgreSQL

IT Support Forum Forums Databases PostgreSQL Installation How To Run Multiple Instances Of PostgreSQL

Viewing 0 reply threads
  • Author
    Posts
    • #2452
      Webmaster
      Keymaster

      It’s possible to run multiple instances of the PostgreSQL service on the same server, but they each have to be on their own port. To register multiple instances of Postgres:

      1. Copy the existing database to a new location for each additional Postgres instance you want to create (you don’t need to copy any other files other than the database – i.e. you do not need to copy the binaries to run the program twice – for clarity, you do not need multiple copies of the exe’s to run multiple instances of Postgres, they all run from the one set of binaries).
      2. Right click the command prompt icon and run it as Administrator
      3. Run the following command, specifying a new port number and different PostgreSQLServiceName for each additional Postgres instance you wish to run:

        pg_ctl.exe register -N PostgreSQLServiceName -U domain\usernames -P password -D “C:\Data\PostgreSQL\BackendDB” -o “-p 5433”

      If the command returned nothing, that means it worked. Check your Windows Services (services.msc) and you should see the mutliple instances of Postgres in the list.

      More information on pg_ctl.exe.

Viewing 0 reply threads
  • You must be logged in to reply to this topic.