two servers on the same port - Mailing list pgsql-hackers

From Eric Haszlakiewicz
Subject two servers on the same port
Date
Msg-id 20081018052149.GA27646@poe.swapsimple.com
Whole thread Raw
Responses Re: two servers on the same port  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I just spent a couple of days trying to figure out why I couldn't start
two servers on the same port, even though I was configuring separate
listen_address values.  I kept gettting errors about shmget failing with
"could not create shared memory segment: Invalid argument".

I finally noticed that the shared memory key mentioned in the error when
starting the second server was the same as what the first server was
 using, which appeared to be generated based off of the port number.

Sure enough when I changed the port, it used a different shared memory
key and started right up.  After searching around on the web a bit
I found some pages that suggested running under different userids
might be necessary.  So, I tried that, and changed the port back to the
standard 5432, and it started up.

Anyway, everything seems to be working fine, but I figured this info
should be a bit easier to find, so here's a couple patches to the
documentation to mention how this works.

eric

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: PGDay.it collation discussion notes
Next
From: Gregory Stark
Date:
Subject: Re: PGDay.it collation discussion notes