Re: Multiple postgresql installations on one machine.

From: Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Charles Tassell <ctassell(at)isn(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Multiple postgresql installations on one machine.
Date: 2001-10-13 16:52:53
Message-ID: 3.0.5.32.20011014005253.015d1980@192.228.128.13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks. I didn't know psql -h did that, thought it was for hostnames only :).

So I resorted to TCP access for the rest of the installations and moved the
sockets out of the way. However the Redhat style initscript tends to
shutdown all installations - even though I specified a different PID file
:(. I guess I might need to fix that one - coz the idea is to have them
independent.

Was actually wondering if I could change the name of the socket to
something like ...portnumber.virtual_host_name_or_ip_address

That way psql -h vhost1 would try usualprefix.defaultport.vhost1

psql by itself would try usualprefix.defaultport

(have to convert dots and slashes in addresses to underscores or something
more innocuous, or quote carefully)

Probably not that useful now that I know more about -h :).

Cheerio,
Link.

At 12:03 AM 10/13/01 -0400, Tom Lane wrote:
>Charles Tassell <ctassell(at)isn(dot)net> writes:
>> I may be wrong, but I don't think it's possible to have them on the same
>> port. The problem is that the TCP/IP port defaults to the same as the
UNIX
>> sockets port, and UNIX sockets are local to the machine, so they are
>> completely independent of IP addresses and can not be duplicated.
>
>Unix sockets need to have unique pathnames in the local filesystem.
>The PG "port number" is actually only a component of the file name.
>So all you need to do if you need to have conflicting port numbers
>is to vary the unix_socket_directory parameter for each postmaster.
>
>However, varying the port number is probably a simpler attack...
>
>>> I can't seem to tell psql where to find the moved unix socket.
>
>Use -h /path/to/directory/containing/socket. AFAIR you can set the
>path in PGHOST environment variable, if that helps.
>
> regards, tom lane
>
>---------------------------(end of broadcast)---------------------------
>TIP 3: if posting/reading through Usenet, please send an appropriate
>subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
>message can get through to the mailing list cleanly
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gurunandan R. Bhat 2001-10-13 17:14:09 Re: Any Good Way To Do Sync DB's?
Previous Message Allan Engelhardt 2001-10-13 16:27:51 Re: [Off-topic, Meta-question] Problems with psql-general list