pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Russ McBride <Russ@psyex.com>
To: nickf@ontko.com
To: looseleaf@gmx.net
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: authentication problems--  success!
Date: Sun, 30 Sep 2001 23:55:37 -0700
Message-ID: <v04210105b7ddbbb172b9@[64.164.9.154]> (raw)
In-Reply-To: <NEBBLAAHGLEEPCGOBHDGAEKHDLAA.nickf@ontko.com>
References: <NEBBLAAHGLEEPCGOBHDGAEKHDLAA.nickf@ontko.com>

Hi guys,

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

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 '127.0.0.1' 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 '127.0.0.1'. 
Shouldn't specifying 'localhost' always force *my* IP to be broadcast 
as 127.0.0.1 (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 . . .

Best,

Russ


>
>
>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://127.0.0.1/testdb" & 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
>---------------------------------------------------------------------
>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/
>
>
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 5: Have you checked our extensive FAQ?
>
>http://www.postgresql.org/users-lounge/docs/faq.html




view thread (2+ messages)  latest in thread

Message-ID: <v04210105b7ddbbb172b9@[64.164.9.154]>
Permalink:  ../v04210105b7ddbbb172b9@%5B64.164.9.154%5D/
Also on:    postgresql.org/message-id/v04210105b7ddbbb172b9@[64.164.9.154]

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: Russ@psyex.com, nickf@ontko.com, looseleaf@gmx.net, tgl@sss.pgh.pa.us
  Subject: Re: authentication problems--  success!
  In-Reply-To: <v04210105b7ddbbb172b9@[64.164.9.154]>
  References: <NEBBLAAHGLEEPCGOBHDGAEKHDLAA.nickf@ontko.com> <v04210105b7ddbbb172b9@[64.164.9.154]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox