Re: [INTERFACES] Re: [QUESTIONS] postgresql-6.3 and jdbc - grief - Mailing list pgsql-interfaces

From Peter T Mount
Subject Re: [INTERFACES] Re: [QUESTIONS] postgresql-6.3 and jdbc - grief
Date
Msg-id Pine.LNX.3.95.980315090211.21425D-100000@maidast
Whole thread Raw
In response to Re: [QUESTIONS] postgresql-6.3 and jdbc - grief  ("Stephan B. Doliov" <doliov@statsol.com>)
List pgsql-interfaces
On Fri, 13 Mar 1998, Stephan B. Doliov wrote:

> Pter Mount wrote:
> > On Fri, 13 Mar 1998, Stephan B. Doliov wrote:
> > > I know i must be doing something inanely stupid but the jdbc driver that
> > >
> > > in pg_hba.conf i have
> > > local      all  password password
> > > host       all  198.11.51.133 255.255.255.224   password password
> > This is your problem, the IP address & mask don't match (for postgresql's
> > purposes).
> > If you are trying to say: only 198.11.51.133 is to have access, then it
> > should read:
> > host       all  198.11.51.133 255.255.255.255   password password
> > but, if you are saying that the network that 198.11.51.133 resides is to
> > have access, and 255.255.255.224 is the netmask, then this should read:
>
> thanks for clarifying my consfusion regarding netmasks (i just did an
> ifconfig -a on my le0 (ethernet) interface and saw the netmask ws
> ffffffe0) and so thought that is what i should put in the pg_hba.conf
> file.
>
> however - the mystery i still have not yet been able to solve is why do i
> have to speccify the host in the url in order to get the jdbc driver to
> work.
> jdbc:postgresql:funnystuff fails
> jdbc:postgresql://198.11.51.133/funnystuff works.
>
> pg_hba.conf reads:
> local   all    password      password
> host    all    198.11.51.133 255.255.255.225   password   password

To get just jdbc:postgresql:funnystuff to work you need to add localhost
to ph_hba.conf, ie:

host all 127.0.0.1 255.255.255.255 password password

ps: the second password isn't required, as 6.3 now uses the pg_shadow
table for storing passwords, and the ALTER USER statement allows you to
change the password - no need to use the pg_password utility.

> is it because poastmaster is running with the -i option?  if i let the
> pg_hba.conf file for local read
> local   all   trust
> i don't need to specify the hostname in the url.

local in pg_hba.conf refers to the UNIX domain socket.

> by and large, i can live with this no problem, it's just that my curiosity
> has been greatly aroused by the observed behavior.

One thing I am doing, is that as some one has a problem like this, I'm
adding it to the FAQ (prior to writing some proper docs) for the JDBC
driver.

--
Peter T Mount  petermount@earthling.net or pmount@maidast.demon.co.uk
Main Homepage: http://www.demon.co.uk/finder
Work Homepage: http://www.maidstone.gov.uk Work EMail: peter@maidstone.gov.uk


pgsql-interfaces by date:

Previous
From: Peter T Mount
Date:
Subject: Re: [INTERFACES] Re: [QUESTIONS] postgresql-6.3 and jdbc -i not the problem
Next
From: Rudi Heitbaum
Date:
Subject: Re: location of latest postodbc source