avoid password prompt if cluster owner can't connect without password
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
postgresql-common (Ubuntu) |
Fix Released
|
Medium
|
Martin Pitt |
Bug Description
When installing postgres-8.1, I am asked for a password. Here's what happens (the second time, after cancelling the first time, but the effect is the same):
murrayc@
Password:
Reading package lists... Done
Building dependency tree... Done
Calculating upgrade...Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0B of archives.
After unpacking 0B of additional disk space will be used.
Do you want to continue [Y/n]?
Setting up postgresql-8.1 (8.1.3-2build1) ...
* Starting PostgreSQL 8.1 database server
Password:
I think it's asking for the password for the postgres user. I don't know what that is. I guess it should already have sudo rights to su to the postgres user if it needs to.
Did you modify pg_hba.conf? I strongly assume that the password prompt is from psql, not from su. The postgres user must be able to access the cluster without a database, see the default pg_hba.conf:
# DO NOT DISABLE!
# If you change this first entry you will need to make sure that the
# database
# super user can access the database using some other method.
# Noninteractive
# access to all databases is required during automatic maintenance
# (autovacuum, daily cronjob, replication, and similar tasks).
#
# Database administrative login by UNIX sockets
local all postgres ident sameuser