Thread: Problem with tcp/ip connection, postgresql.conf

Problem with tcp/ip connection, postgresql.conf

From
"Nick Fankhauser"
Date:
Hi-

I'm posting this summary for a person that I've been corresponding with
off-list:

He is trying to use JDBC, so he wants to turn on the TCP/IP socket.

The platform is Postgresql 7.2 on SuSe 8.0

If he starts the postmaster with the -i flag, he can get a connection.

If he sets tcpip_socket = 1 in postgresql.conf, but doesn't use the -i flag
on startup, it doesn't work.

So far, my suggestions have been to make sure the postgresql.conf file is in
the data directory and is readable. Beyond this I can't think of anything,
but I've never used the SuSe distribution, so there may be something odd
about the directory structure that I'm missing.

Is there a SuSe user on the list that can help?

Thanks
    -Nick

---------------------------------------------------------------------
Nick Fankhauser

    nickf@doxpop.com  Phone 1.765.965.7363  Fax 1.765.962.9788
doxpop - Court records at your fingertips - http://www.doxpop.com/


Re: Problem with tcp/ip connection, postgresql.conf

From
Tom Lane
Date:
"Nick Fankhauser" <nickf@ontko.com> writes:
> If he starts the postmaster with the -i flag, he can get a connection.
> If he sets tcpip_socket = 1 in postgresql.conf, but doesn't use the -i flag
> on startup, it doesn't work.

> So far, my suggestions have been to make sure the postgresql.conf file
> is in the data directory and is readable. Beyond this I can't think of
> anything,

A couple of simple mistakes we've seen recently are to forget to remove
the '#' comment leader from the line, or to be editing the wrong copy of
the file (not the one in $PGDATA).

While experimenting with this, I noted that the postmaster will not
complain if postgresql.conf is not found --- though it will complain if
it finds the file but can't read it (eg permission failures).  It seems
to me this is a bug, or at any rate a bad idea.  There should be at least
a warning message if the postgresql.conf file isn't found, and quite
possibly the postmaster should refuse to start at all, on the grounds
that you may have pointed it to a a bogus data directory.

Any opinions about this out there?

            regards, tom lane

Re: Problem with tcp/ip connection, postgresql.conf

From
"Nick Fankhauser"
Date:
> While experimenting with this, I noted that the postmaster will not
> complain if postgresql.conf is not found --- though it will complain if
> it finds the file but can't read it (eg permission failures).  It seems
> to me this is a bug, or at any rate a bad idea.  There should be at least
> a warning message if the postgresql.conf file isn't found, and quite
> possibly the postmaster should refuse to start at all, on the grounds
> that you may have pointed it to a a bogus data directory.
>
> Any opinions about this out there?

I agree that there should at least be a warning if the file is not found.
Ironically, the problem in this case turned out to be the permissions, so
apparently the existing warning didn't clue one person into what was
happening until I made the suggestion about permissions more explicitly.

-Nick


Re: Problem with tcp/ip connection, postgresql.conf

From
Robert Treat
Date:
On Sun, 2003-06-08 at 11:50, Tom Lane wrote:
>
> While experimenting with this, I noted that the postmaster will not
> complain if postgresql.conf is not found --- though it will complain if
> it finds the file but can't read it (eg permission failures).  It seems
> to me this is a bug, or at any rate a bad idea.  There should be at least
> a warning message if the postgresql.conf file isn't found, and quite
> possibly the postmaster should refuse to start at all, on the grounds
> that you may have pointed it to a a bogus data directory.
>
> Any opinions about this out there?
>

IIRC this was going to be addressed in the "option to put config files
anywhere" patch.  if not it should at least issue a warning. I'd
actually be in favor of explicit error/refusal to start if it didn't
seem so draconian.

Robert Treat
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


Re: Problem with tcp/ip connection, postgresql.conf

From
Bruce Momjian
Date:
Add to TODO:

    * Exit postmaster if postgresql.conf can not be opened


---------------------------------------------------------------------------

Robert Treat wrote:
> On Sun, 2003-06-08 at 11:50, Tom Lane wrote:
> >
> > While experimenting with this, I noted that the postmaster will not
> > complain if postgresql.conf is not found --- though it will complain if
> > it finds the file but can't read it (eg permission failures).  It seems
> > to me this is a bug, or at any rate a bad idea.  There should be at least
> > a warning message if the postgresql.conf file isn't found, and quite
> > possibly the postmaster should refuse to start at all, on the grounds
> > that you may have pointed it to a a bogus data directory.
> >
> > Any opinions about this out there?
> >
>
> IIRC this was going to be addressed in the "option to put config files
> anywhere" patch.  if not it should at least issue a warning. I'd
> actually be in favor of explicit error/refusal to start if it didn't
> seem so draconian.
>
> Robert Treat
> --
> Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073