Thread: More than one installation on the same machine

More than one installation on the same machine

From
Jay R
Date:
Hi, I'm using Postgresql as the database for my
website (which is running Apache and mod_perl), and I
want to upgrade my database from 7.2 to 7.3, but I'd
like to test that everything's working before I make
the switch on my live site.  The problem is, it's the
same machine running both my development and live
environments.

I've installed 7.3 in its own directory, using the
default configuration parameters, and I gather from
the 7.3 documentation that I need to start it up on a
different port and provide a different socket to point
DBI::Pg at.  (7.2 has port 5432 and a socket in /tmp)
 But I couldn't figure out quite how to do it, based
on the documentation.  If anyone can provide me with
more detailed instructions (or point me at them if
they're out on the web somewhere), I'd be much
obliged.

Thanks,
Jay


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Re: More than one installation on the same machine

From
Tom Lane
Date:
Jay R <jaysjaded@yahoo.com> writes:
> I've installed 7.3 in its own directory, using the
> default configuration parameters, and I gather from
> the 7.3 documentation that I need to start it up on a
> different port and provide a different socket to point
> DBI::Pg at.  (7.2 has port 5432 and a socket in /tmp)
>  But I couldn't figure out quite how to do it, based
> on the documentation.

Use "-D dir" or set $PGDATA to point initdb at a nonstandard data
directory.  Then start the new postmaster with the same switch or
environment, plus a "-p port" switch (or instead of -p, set the port
number in postgresql.conf).

Client-side code will also need to be pointed at that port.  If you were
using libpq-derived code you could handle this transparently by setting
$PGPORT in the client ennvironment, but I forget whether that works for
DBI::Pg.

            regards, tom lane

Re: More than one installation on the same machine

From
Bruno Wolff III
Date:
On Fri, Jul 25, 2003 at 23:42:02 -0700,
  Jay R <jaysjaded@yahoo.com> wrote:
> I've installed 7.3 in its own directory, using the
> default configuration parameters, and I gather from
> the 7.3 documentation that I need to start it up on a
> different port and provide a different socket to point
> DBI::Pg at.  (7.2 has port 5432 and a socket in /tmp)
>  But I couldn't figure out quite how to do it, based
> on the documentation.  If anyone can provide me with
> more detailed instructions (or point me at them if
> they're out on the web somewhere), I'd be much
> obliged.

I use Pg.pm, but I think this may help.
I put:
SetEnv PGPORT 5433
in appropiate .htaccess files to have an area of my web site use the development
postgres instead of 7.3.3 which runs on the default port.

This makes it easy to switch back if I grab a new copy of 7.4 and it
has problems. (The databases are essentially static so I can keep both
loaded and switch back and forth without causing problems.)