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
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 542426-postgresql-password-notice.patch | 819 bytes | josh waihi |
| #4 | 542426-postgresql-password-notice.patch | 818 bytes | josh waihi |
| database.pgsql_.passoptional.patch | 826 bytes | neilnz |
Comments
Comment #1
Shiny commentedtested in postgres 8.3.7
sweet as.
Comment #2
josh waihi commentedcool, I'm happy - easy fix.
Comment #4
josh waihi commentedlets try a git patch with the '--no-prefix' option.
Comment #5
damien tournoud commentedPlease add a proper full stop at the end of the comment, and I'm happy too.
Comment #6
josh waihi commenteddone.
Comment #7
damien tournoud commentedAcked.
Comment #8
webchickCommitted to HEAD. Thanks!