Re: Can I install 2nd set of postgresql into the same server?

From: Richard Huxton <dev(at)archonet(dot)com>
To: アムス <ams(at)asiams(dot)com>, "pgsql-general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Can I install 2nd set of postgresql into the same server?
Date: 2002-11-14 11:37:53
Message-ID: 200211141137.53993.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday 14 Nov 2002 5:36 am, アムス wrote:
> I am using rental server with root access. The server was initially set up
> with postgresql, but the db is used only for the server maintanance.
>
> I could not get connected to the database.
>
> The db was started with -i option. But still, I can not get it connected.
>
> The portnumber should be 5432 as default.
>
> Q1. How can I check to see if postgresql is using port 5432?

Try the "lsof" command "lsof -i" will list all processes that have any ports
open.

> I have put PGPORT=5432 at .bash_profile and exported it to make sure it is
> using port number 5432. But still I could not get connected.
>
> Here is the part of the program I use.
>
> php3 file has the following code:
>
> <?
> include("gw.conf");
> include("include/admchk.func");
> $conn = @pg_Connect($host,"5432","","",$masterdb);
> if (!$conn) {
> echo "<B>Can not connect to the database.</B><BR>\n";
> exit;
> }
> ?>
>
> Each time I run this portion, I get the error of not connected to the db.

Try checking the pg_errormessage($conn)

> Q2. Can anyone help me find out what to look for in order to correct this
> problem?

If PG is listening on the port, and there's no firewall interfering then it's
probably the settings in your pg_hba.conf - make sure the host you connect
from (localhost?) is listed as allowing connections. See the manuals for
details.

> Q3. Can I install another copy of postgresql into the existing server?
> Another words, can I stall another copy of postgresql which will not
> interrupt to the previous set of postgresql?

I seem to remember doing this (I use a separate machine for testing now).
Install to a different location, make sure you initdb a different location
and choose a different port for the new PostgreSQL to listen on.

HTH
--
Richard Huxton

In response to

Browse pgsql-general by date

  From Date Subject
Next Message snpe 2002-11-14 13:31:11 Re: [JDBC] [HACKERS] PostgreSQL JDBC and sub-select
Previous Message Simeó Reig 2002-11-14 11:29:57 Re: [GENERAL] TUTORIAL POSTGRESQL PHP ESPAÑOL-PORTUGUES?