Re: jdbc pg_hba.conf error - Mailing list pgsql-general
From | Bhavana.Rakesh |
---|---|
Subject | Re: jdbc pg_hba.conf error |
Date | |
Msg-id | 465EC645.3010905@noaa.gov Whole thread Raw |
In response to | Re: jdbc pg_hba.conf error (Tom Lane <tgl@sss.pgh.pa.us>) |
Responses |
Re: jdbc pg_hba.conf error
Re: jdbc pg_hba.conf error |
List | pgsql-general |
Ok,
I confirmed that I'm editing the right pg_hba.conf file. I made sure that there are no other postmasters running. I made sure that there is a user called 'brakesh'. I restart the postmaster everytime I make any changes to pg_hba.conf file. But still same results!
[brakesh@lnx383 ~/db_connect]$ psql -U brakesh -h 127.0.0.1 -d testing123
psql: FATAL: no pg_hba.conf entry for host "127.0.0.1", user "brakesh", database "testing123", SSL off
[brakesh@lnx383 ~/db_connect]$ psql -p 5000 testing123
Welcome to psql 7.4.17, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
______________________________________
Here is my pg_hba.conf file again. I've commented the different records that I've experimented with. But none of them worked. Of course, when i commented out the first record
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
local all all trust
I couldn't connect using the 'psql -p 5000 testing123'..which confirmed that I'm editing the right pg_hba.conf file. My current working copy of pg_hba.conf file follows:
____________________________________________
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
local all all trust
# IPv4-style local connections:
#host all all 127.0.0.1 255.255.255.255 trust
#host testing123 brakesh 127.0.0.1 255.255.255.255 trust
hostnossl testing123 brakesh 127.0.0.1 255.255.255.255 trust
#hostnossl all all 127.0.0.1 255.255.255.255 trust
#hostnossl testing123 brakesh 127.0.0.1 255.255.255.255 trust
# IPv6-style local connections:
#host all all ::1/128 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff trust
#Allow any user from any host with IP address 140.90.193.238 to
# connect to database "testing123" as the same username that ident on that
# host identifies him as (typically his Unix username):
#
#TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
#hostnossl testing123 all 140.90.193.238 255.255.255.0 ident sameuser
Tom Lane wrote:
I confirmed that I'm editing the right pg_hba.conf file. I made sure that there are no other postmasters running. I made sure that there is a user called 'brakesh'. I restart the postmaster everytime I make any changes to pg_hba.conf file. But still same results!
[brakesh@lnx383 ~/db_connect]$ psql -U brakesh -h 127.0.0.1 -d testing123
psql: FATAL: no pg_hba.conf entry for host "127.0.0.1", user "brakesh", database "testing123", SSL off
[brakesh@lnx383 ~/db_connect]$ psql -p 5000 testing123
Welcome to psql 7.4.17, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
______________________________________
Here is my pg_hba.conf file again. I've commented the different records that I've experimented with. But none of them worked. Of course, when i commented out the first record
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
local all all trust
I couldn't connect using the 'psql -p 5000 testing123'..which confirmed that I'm editing the right pg_hba.conf file. My current working copy of pg_hba.conf file follows:
____________________________________________
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
local all all trust
# IPv4-style local connections:
#host all all 127.0.0.1 255.255.255.255 trust
#host testing123 brakesh 127.0.0.1 255.255.255.255 trust
hostnossl testing123 brakesh 127.0.0.1 255.255.255.255 trust
#hostnossl all all 127.0.0.1 255.255.255.255 trust
#hostnossl testing123 brakesh 127.0.0.1 255.255.255.255 trust
# IPv6-style local connections:
#host all all ::1/128 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff trust
#Allow any user from any host with IP address 140.90.193.238 to
# connect to database "testing123" as the same username that ident on that
# host identifies him as (typically his Unix username):
#
#TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
#hostnossl testing123 all 140.90.193.238 255.255.255.0 ident sameuser
Tom Lane wrote:
Oliver Elphick <olly@lfix.co.uk> writes:His original message (which I snipped) said he had:# IPv4-style local connections: host all all 127.0.0.1 255.255.255.255 trust host testing123 brakesh 127.0.0.1 255.255.255.255 trustSo it seems to me he did have it configured.I've seen similar problems resolved by discovering that (1) the DBA was editing the wrong copy of the pg_hba.conf file, or (2) there was actually more than one postmaster running on the machine. Check "ps" for multiple postmasters. Put a deliberate error in the pg_hba.conf file and verify that the postmaster fails to restart. regards, tom lane
pgsql-general by date: