"Aurangzeb M. Agha" <aagha(at)bigfoot(dot)com> writes:
> $ pg_ctl start -D . -o -i
> postmaster successfully started
> FATAL: StreamServerPort: bind() failed: Address already in use
> Is another postmaster already running on port 5432?
> If not, wait a few seconds and retry.
> /usr/local/pgsql/bin/postmaster: cannot create INET stream port
> BUT, if I do:
> $ postmaster -D . -o -i -p 5432
These are not the same command: in particular -o means completely
different things. I expect that
$ postmaster -D . -i -p 5432
(which is what pg_ctl will do) will fail.
You may be able to find what process is using TCP port 5432 by using
netstat or lsof or some such tool.
regards, tom lane