Index: openacs-4/packages/acs-tcl/tcl/00-database-procs-postgresql.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/00-database-procs-postgresql.tcl,v diff -u -r1.27 -r1.28 --- openacs-4/packages/acs-tcl/tcl/00-database-procs-postgresql.tcl 20 Nov 2001 21:49:52 -0000 1.27 +++ openacs-4/packages/acs-tcl/tcl/00-database-procs-postgresql.tcl 21 Nov 2001 01:26:11 -0000 1.28 @@ -658,16 +658,24 @@ set pgpass "<<$pgpass" } - set pghost [db_get_dbhost] - if { ![string equal $pghost ""] } { - set pghost "-h $pghost" + # DRB: Submitted patch was in error - the driver opens a -h hostname connection + # unless the hostname is localhost. We need to do the same here. The submitted + # patch checked for a blank hostname, which fails in the driver. Arguably the + # driver's wrong but a lot of non-OpenACS folks use it, and even though I'm the + # maintainer we shouldn't break existing code over such trivialities... + + if { [string equal [db_get_dbhost] "localhost"] } { + set pghost "" + } else { + set pghost "-h [db_get_dbhost]" } cd [file dirname $file] if { $tcl_platform(platform) == "windows" } { set fp [open "|[file join [db_get_pgbin] psql] -h [ns_info hostname] $pgport $pguser -f $file_name [db_get_database]" "r"] } else { +ns_log Notice "Huh? |[file join [db_get_pgbin] psql] $pghost $pgport $pguser -f $file_name [db_get_database] $pgpass" set fp [open "|[file join [db_get_pgbin] psql] $pghost $pgport $pguser -f $file_name [db_get_database] $pgpass" "r"] }