Re: [INTERFACES] Re: [QUESTIONS] postgresql-6.3 and jdbc - grief

From: Peter T Mount <pgint(at)maidast(dot)demon(dot)co(dot)uk>
To: "Stephan B(dot) Doliov" <doliov(at)statsol(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: [INTERFACES] Re: [QUESTIONS] postgresql-6.3 and jdbc - grief
Date: 1998-03-15 09:08:57
Message-ID: Pine.LNX.3.95.980315090211.21425D-100000@maidast
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)earthling(dot)net or pmount(at)maidast(dot)demon(dot)co(dot)uk
Main Homepage: http://www.demon.co.uk/finder
Work Homepage: http://www.maidstone.gov.uk Work EMail: peter(at)maidstone(dot)gov(dot)uk

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Rudi Heitbaum 1998-03-15 10:41:23 Re: location of latest postodbc source
Previous Message Peter T Mount 1998-03-15 08:59:30 Re: [INTERFACES] Re: [QUESTIONS] postgresql-6.3 and jdbc -i not the problem