Skip site navigation (1) Skip section navigation (2)

Re: authentication problems-- success!

From: Russ McBride <Russ(at)psyex(dot)com>
To: nickf(at)ontko(dot)com, looseleaf(at)gmx(dot)net, pgsql-admin(at)postgresql(dot)org
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Re: authentication problems-- success!
Date: 2001-10-01 06:55:37
Message-ID: v04210105b7ddbbb172b9@[] (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
Hi guys,

>When you specify the database URL in your java code, try explicitly naming
>either localhost or

Thanks for all the time you guys spent thinking about this 
authentication problem and writing me.  I changed the URL in the java 
code from 'localhost' to '' and it worked fine (duh).

I also discovered the following interesting fact further showing that 
the problem is OS-specific and has nothing to do with the way 
postgreSQL is functioning.  On my Mac 10.03-os machine, it makes no 
difference what my network settings are, whether my ports are active, 
etc.  When I connect to a pg database locally, it goes fine.  On my 
Mac 10.1-os machine, however, when I try to make a connection to 
localhost it advertises my IP to postgresql as the first of whatever 
active port settings I happen to have active at that time.  Only if I 
switch off all ports does my IP get advertised as ''. 
Shouldn't specifying 'localhost' always force *my* IP to be broadcast 
as (or whatever 'localhost' may have been changed to in 
/etc/hosts) regardless of what other network stuff is going on?  This 
problem still remains a mystery to me, but at least I know what my 
new os is doing, if not why, or how to fix what it's doing.

What started off as a "quick" check to make sure that pg worked on 
10.1 as well as 10.0.x versions before completing my installation 
documentation turned into a full on adventure, ending with this 
authentication challenge.  I'm looking forward to getting some of the 
actual work done now.

If anyone needs help with their Mac OS X installation send me an 
e-mail.  I think we've got it pretty well figured out now . . .



>Supposedly, JDBC always defaults to localhost if a host is not specified,
>but from what we've learned so far, psql seems to have no problem if you
>explicitly point it to localhost using an IP connection, whereas JDBC
>doesn't connect when left to take the implicit default.
>So try either "jdbc:postgresql://localhost/testdb" or
>"jdbc:postgresql://" & see what happens.
>If either works, you have at least achieved your goal of a stable local JDBC
>connection that doesn't depend on the actual IP address of the local
>machine. You'll also have one more clue to ponder if you can't sleep nights
>without knowing *why* the default isn't working as expected.
>You mentioned at the start of this thread that it works fine for you an a
>different machine- is the working machine also running Mac OS 10.1?
>Nick Fankhauser
>    nickf(at)doxpop(dot)com  Phone 1.765.965.7363  Fax 1.765.962.9788
>doxpop - Court records at your fingertips -
>---------------------------(end of broadcast)---------------------------
>TIP 5: Have you checked our extensive FAQ?

In response to


pgsql-admin by date

Next:From: Manuel TrujilloDate: 2001-10-01 07:49:31
Subject: Re: about the time of a process
Previous:From: Nick FankhauserDate: 2001-09-30 20:14:57
Subject: Re: authentication problems

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group