Re: Problem Adding A PostgreSQL Server in Debian - Mailing list pgadmin-support

From Sunburned Surveyor
Subject Re: Problem Adding A PostgreSQL Server in Debian
Date
Msg-id 71097ae20601041952w5c5e0055n7a6475d42cad41a1@mail.gmail.com
Whole thread Raw
In response to Problem Adding A PostgreSQL Server in Debian  (Sunburned Surveyor <sunburned.surveyor@gmail.com>)
Responses Re: Problem Adding A PostgreSQL Server in Debian  (Andreas Pflug <pgadmin@pse-consulting.de>)
List pgadmin-support
I had posted a couple of weeks back about a problem I had using pgAdmin3. I was basically unable to add a new server to PostgreSQL from pgAdmin. I received the following error message:
 
"An error has occurred: Error connecting to the server: FATAL:IDENT authentication failed for user "myuser" "
 
I was able to determine the cause of this error. (Sort of...) I wanted to post it back to the list so that other newbies might run across it while they are searching the archives.
 
Apparently there are a couple of ways to connect to PostgreSQL from a client. One of them is via UNIX sockets as a UNIX user. (Or Linux Sockets as a Linux User.) Another is via TCP/IP.
 
I could successfully connect to PostgreSQL and issue commands via the psql command prompt. With this command for example:
 
psql -U postgres tempate1
 
However, I couldn't connect with this command:
 
psql -h localhost -U postgres template1
 
This meant that I was connecting as a Linux user via a socket, and not via TCP/IP.
 
If this happens to you, there are a couple of things that you can check:
 
[1] Issue the 2 commands mentioned above. If the first one works, but the second one generates the error message, you probably have the same problem I did.
 
[2] Make sure that postgresql.conf file contains a line that reads "tcpip_socket = true", not "tcpip_socket = false". On my Debian Sarge system the postgresql.conf file could be found at /etc/postgresql/ You will need root access privileges to modify it.
 
[3] Make sure that your pg_hba.conf file is set up to accept tcp/ip connections. I believe this is done by accepting all connections on the local host. You should have a line in your hba_conf.file that looks like this:
 
host   all   all   127.0.0.1   255.255.255.255   trust
 
(This might set up your PostgreSQL to accept all connections from the local or host computer. You might not want this. Perhaps one of the other experts can tell us how to set up the file to allow tcp/ip access but maintain password verification on the local computer.)
 
On my Debian Sarge system you can find the postgresql.conf file at /etc/postgresql. You will need root access privileges to modify it.
 
 
I hope this will help any pgAdmin 3 users that run into the same problem I did. I am curious why I didn't recieve a response from the mailing list. Did I violate a rule of ettiquette, or not provide enough information?
 
My next question would be:
 
How do you set up pgAdmin to connect to PostgreSQL via Unix Sockets?
 
I believe I read that this can be done with pgAdmin3.
 
Thanks,
 
The Sunburned Surveyor

 
On 12/16/05, Sunburned Surveyor <sunburned.surveyor@gmail.com> wrote:

I've installed PostgreSQL, and set it up with a user that has the same user name and password as one of the Linux Users. I have no problem logging into the psql terminal with the user via the command line. Once I am logged into psql, I can execute the CREATE DATABASE and CREATE TABLE commands with no problem.

 However, when I tried to add a server in pgAdmin3 with the same user and password, I get this error:

 "An error has occurred:

Error connecting to the server: FATAL:IDENT authentication failed for user "myuser" "

 I have checked my pg_hba.conf file and everything appears to be as it should be. (Although I'm not an expert, and I could be missing something.) It is set up to accepts all connections from the local machine.

 Do you guys have any suggestions for me? I'm thinking the problem is with pgAdmin3, since I can connect to PostgreSQL via the psql terminal with no problems, but I'm not sure.

I'm running the latest stable version of both PostgreSQL and pgAdmin3. 

Thanks,

The Sunburned Surveyor

 


pgadmin-support by date:

Previous
From: "Dave Page"
Date:
Subject: Re: 1.4.1 missing feature?
Next
From: Andreas Pflug
Date:
Subject: Re: Problem Adding A PostgreSQL Server in Debian