From: | "Bhavana(dot)Rakesh" <Bhavana(dot)Rakesh(at)noaa(dot)gov> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | chris smith <dmagick(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: jdbc pg_hba.conf error |
Date: | 2007-06-05 13:35:46 |
Message-ID: | 466566B2.2000705@noaa.gov |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Starting the postmaster with a "-i" option did the trick.
/ -i Allows clients to connect via TCP/IP (Internet domain)
connections. Without this
option, only local Unix domain socket connections are
accepted. This option corre-
sponds to setting tcpip_socket=true in postgresql.conf.
--tcpip-socket=false has the opposite effect of this option.
/However, this still does not solve my problem of having a java
application connect to the postgres DB server. I get the following error:
Couldn't connect: print out a stack trace and exit.
org.postgresql.util.PSQLException: A connection error has occurred:
org.postgres ql.util.PSQLException: FATAL: no
pg_hba.conf entry for host "127.0.0.1", user "b
rakesh", database "testing123", SSL off
at
org.postgresql.jdbc1.AbstractJdbc1Connection.openConnectionV3(Abstrac
tJdbc1Connection.java:337)
at
org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJ
dbc1Connection.java:214)
at org.postgresql.Driver.connect(Driver.java:139)
at java.sql.DriverManager.getConnection(DriverManager.java:559)
at java.sql.DriverManager.getConnection(DriverManager.java:189)
at db_connect_pgsql.main(db_connect_pgsql.java:25)
-Bhavana
Tom Lane wrote:
> "Bhavana.Rakesh" <Bhavana(dot)Rakesh(at)noaa(dot)gov> writes:
>
>> Here's what happens when I specify the port number
>>
>
>
>> [brakesh(at)lnx383 ~]$ psql -U brakesh -p 5000 -h 127.0.0.1 -d testing123
>> psql: could not connect to server: Connection refused
>> Is the server running on host "127.0.0.1" and accepting
>> TCP/IP connections on port 5000?
>>
>
> 5000 being a nonstandard port number, it's certainly possible that the
> kernel is filtering this connection attempt. "Connection refused" might
> mean either that there's no process listening to TCP port 5000, or that
> the kernel rejected the connection before looking for a listening process.
>
> In any case it seems highly probable that you do have two postmasters
> running on this machine, one at port 5000 and one at port 5432. The
> psql calls without an explicit -p switch would have defaulted to port
> 5432 unless you've done something strange to your installation.
>
> regards, tom lane
>
From | Date | Subject | |
---|---|---|---|
Next Message | Erwin Brandstetter | 2007-06-05 13:36:41 | Re: There can be only one! How to avoid the "highlander-problem". |
Previous Message | Gregory Stark | 2007-06-05 13:35:32 | Re: Foreign keys and indexes |