Re: Poatgresql database on more than one disk - Mailing list pgsql-general

From Philip A. Chapman
Subject Re: Poatgresql database on more than one disk
Date
Msg-id 1086030878.3199.16.camel@wayfarer.pcsw.us
Whole thread Raw
In response to Poatgresql database on more than one disk  (bgraetz@bigpond.net.au (Barry))
Responses Re: Poatgresql database on more than one disk
List pgsql-general
On Tue, 2004-05-25 at 18:33, Barry wrote:
> I would like to be able to use one disk pack for development and the
> other for end user testing / verification (the tape drive can only backup
> one disk pack completely, not both)
>
> Is it possible to configure Postgresql to have seperate databases
> on seperate disks ?
>

One solution is to run two postmasters (two services).  Each would use a
different value for the PGDATA environment variable.

The pro to this is that there would be a greater degree of separation
between your development environment and test environment.  You could
start and stop the development environment service separately from the
test environment, for instance.

The con is that only one postmaster can bind to port 5432 at a time.
You would have to set up one of the postmasters to use a different
port...  perhaps 5433?

Since you are using RedHat, take a look at /etc/init.d/postgresql.  You
should see where the the PGDATA environment variable is set in the top
of the script.  PGPORT is also set, which is the port number that the
postmaster will use.  (I am using Fedora Core 1 and Fedora Core 2.  I
assume that RedHat's scripts are very similar to this, if not
identical).

If I were doing it, I'd probably copy /etc/init.d/postgresql to
/etc/init.d/postgresql_dev and /etc/init.d/postgresql_test.  I'd modify
/etc/init.d/postgresql_test so that it controls my test environment and
/etc/init.d/postgresql_dev so that it controls my development
environment.  I'd use chkconfig to disable the service postgresql and
enable the services postgresql_dev and postgresql_test.  (That way, if
upgrades clobber /etc/init.d/postgresql, you're not left in a bind).

You can contact me off-list if you need more help with this solution.

--
Philip A. Chapman

Application Development:
Java, Visual Basic (MCP), PostgreSQL, MySQL, MSSQL
Linux, Windows 9x, Windows NT, Windows 2000, Windows XP

Attachment

pgsql-general by date:

Previous
From: Oliver Elphick
Date:
Subject: Re: multiple count functions in a select statement
Next
From: "TroyGeek"
Date:
Subject: PostgreSQL Tablespaces