I'd think the problem is somewhere in your PAM setup. For some reason "su" is asking for a password even when running as root:
su -s /bin/sh postgres -c "test -O /var/lib/postgresql &&
test -G /var/lib/postgresql" || \
chown postgres:postgres /var/lib/postgresql
To be sure where it is really asking, add "set -x" to the beginning of /var/lib/dpkg/info/postgresql-common.postinst and do the dpkg --configure -a again.
I'd think the problem is somewhere in your PAM setup. For some reason "su" is asking for a password even when running as root:
su -s /bin/sh postgres -c "test -O /var/lib/postgresql && postgresql" || \
test -G /var/lib/
chown postgres:postgres /var/lib/postgresql
To be sure where it is really asking, add "set -x" to the beginning of /var/lib/ dpkg/info/ postgresql- common. postinst and do the dpkg --configure -a again.