package manager, postgresql, pgAdmin3 problems

Questions about applications and software
Forum rules
Before you post please read how to get help
Level 1
Level 1
Posts: 2
Joined: Sun Jun 14, 2009 9:10 pm

package manager, postgresql, pgAdmin3 problems

Postby grumble » Sun Jun 14, 2009 10:24 pm

Hi Good People,

I recently installed postgresql using synaptic package manager and have run into a few problems.
What would be really nice, would be if synaptic installed and configured postgresql for me, and recorded everything in a log file, so I could look-up what it did (anyone?). Unfortunately, this is not what happens, and I have to do a fair bit of post-installation configuration myself. The problem with this is that I'm not sure how much (and precisely what) synaptic has done for me. It seems its got man paths sorted nicely, so I can use man to lookup postgresql commands. Nice (not sure how this was achieved however). Unfortunately it did not create the "postgres" user for me, nor did it set $PATH to point to the postgresql commands, nor did it setup the required "data" directory, and tell postgres where it is. OK, so I create "postgres" and set up the data directory. OK, now I can use
sudo su postgres

to change to the postgres user, and I can start postgresql from the command line and enter SQL commands etc. Nice.
OK, now I want to add a path to $PATH so that I can easily invoke postgresql commands. For some reason, the $HOME directory of postgres is /var/lib/postgresql
There is no ".bash_proflie" file there. I create one, and add
export PATH

to it, but this has no effect. OK, so I edit /etc/profile and add similar commands to the end of that. This changes $PATH for my normal login, but when I sudo su postgres, $PATH is reset. :? I wonder if I should delete and recreate the postgres user, but I wonder if the new postgres will still own the directories owned by the old postgres!?!? I guess this would be a security problem if so!?

I also want to use pgAdmin3 (and other apps) with my database. I install pgAdmin3 using synaptic, but it tells me it can't connect to the database with the message.
FATAL: Ident authentication failed for user "postgres"

it tells me, really helpfully, that
"If this message appears, the pg_hba.conf entry found for your client / user / database combination is set to "ident" authentication. Some distributions, e.g. Debian, have this by default.... For a beginner, it might be more appropriate to use a different authentication method; MD5 encrypted passwords are a good choice, which can be configured by an entry in pg_hba.conf..."

Nice. Unfortunately changes to pg_hba.conf seem to have no effect. BTW, should I be starting the database server before I start pgAdmin3, or should it take care of that itself? I note that, when I use

at the command I get and error, but

works OK.

Any helpful comments or similar stories out there?

Level 8
Level 8
Posts: 2158
Joined: Thu Feb 26, 2009 8:58 pm

Re: package manager, postgresql, pgAdmin3 problems

Postby emorrp1 » Sun Jun 21, 2009 6:04 am

Ok, I'm guessing a bit here, but it's been a week and no-one more knowledgeable has posted, so I'll try my best. I think you're meant to add your user to the postgres group to allow your user access, rather than a specific postgres user. The postgres user's home would be /home/postgres, so it would be there you want to add the PATH export for your postgres user, however the global profile file you found and edited is what you really want, as it should be read by any user who needs it. You could also add it to your own .profile once you've added it to the postgres group. To be sure any settings you change are applied, I'd reboot, just to be sure, but stopping the server while you make the changes, then starting again should be sufficient. If any of this info is useless, I'm sorry.
If you have a question that has been answered and solved, then please edit your original post and put a [SOLVED] at the end of your subject header
Hint - use a google search including the search term

User avatar
Level 17
Level 17
Posts: 7543
Joined: Wed Jun 17, 2009 8:20 pm

Re: package manager, postgresql, pgAdmin3 problems

Postby DrHu » Sun Jun 21, 2009 8:12 am

Installed PostgreSQL, pgadmin3 based on the web page below; Ubuntu community documentation
--fix up the install, create the user correctly based on the link above, and you should be ok.

PostgreSQL version 8.2 is in synaptic package manager..

Return to “Software & Applications”

Who is online

Users browsing this forum: No registered users and 27 guests