Hi there,

This is a bit of a regression in D7. Previously this was addressed for D5/D6 in bugs such as #125105: pgsql - pg_connect string in install.pgsql.inc fails to connect on blank password.

Many people run PostgreSQL in "trust" mode when in a controlled environment to avoid the need to remember/type passwords where they wouldn't offer any additional security. Drupal has historically allowed a DSN like pgsql://user@host/dbname without a password being specified. In Drupal 7, if 'password' isn't supplied in the settings.php db array, an E_NOTICE error is raised on each page request, although Drupal still connects fine.

I've made a minor patch against the Postgres driver to detect this parameter being missing/empty in settings.php and set it to null (which is what PDO expects for a trust auth connection).

This doesn't affect installs where the database creds are supplied via the install process, this only affects people manually configuring settings.php through packaging scripts etc (as we do).

Thanks

Comments

Shiny’s picture

Status: Needs review » Reviewed & tested by the community

tested in postgres 8.3.7
sweet as.

josh waihi’s picture

Issue tags: +Quick fix

cool, I'm happy - easy fix.

Status: Reviewed & tested by the community » Needs work

The last submitted patch failed testing.

josh waihi’s picture

Status: Needs work » Needs review
StatusFileSize
new818 bytes

lets try a git patch with the '--no-prefix' option.

damien tournoud’s picture

Priority: Minor » Normal
Status: Needs review » Needs work

Please add a proper full stop at the end of the comment, and I'm happy too.

josh waihi’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new819 bytes

done.

damien tournoud’s picture

Acked.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thanks!

Status: Fixed » Closed (fixed)
Issue tags: -Quick fix

Automatically closed -- issue fixed for 2 weeks with no activity.