Ubuntu 8.04 fixes
authorJamie Cameron <jcameron@webmin.com>
Wed, 30 Apr 2008 21:02:30 +0000 (21:02 +0000)
committerJamie Cameron <jcameron@webmin.com>
Wed, 30 Apr 2008 21:02:30 +0000 (21:02 +0000)
postgresql/CHANGELOG
postgresql/config-debian-linux-4.0-*
postgresql/postgresql-lib.pl

index 7334a3d..55b7444 100644 (file)
@@ -64,3 +64,5 @@ Improved support for Debian/Ubuntu systems that can have different PostgreSQL ve
 Fixed a bug that prevented 'Jump to row' from working properly.
 ---- Changes since 1.400 ----
 Added a Module Config option to show databases and tables using just their names.
+---- Changes since 1.410 ----
+Improve support for PostgreSQL 8.3 on Ubuntu 8.04.
index e12af50..feda139 100644 (file)
@@ -1,12 +1,12 @@
-hba_conf=/etc/postgresql/7.4/main/pg_hba.conf  /etc/postgresql/8.2/main/pg_hba.conf
+hba_conf=/etc/postgresql/*/main/pg_hba.conf
 psql=/usr/bin/psql
-start_cmd=if [ -r /etc/init.d/postgresql-7.4 ]; then /etc/init.d/postgresql-7.4 start; else /etc/init.d/postgresql-8.2 start; fi
+start_cmd=/etc/init.d/postgresql-* start
+stop_cmd=/etc/init.d/postgresql-* stop
 basedb=template1
 perpage=25
 plib=
 pass=
 login=postgres
-stop_cmd=if [ -r /etc/init.d/postgresql-7.4 ]; then /etc/init.d/postgresql-7.4 stop; else /etc/init.d/postgresql-8.2 stop; fi
 pid_file=/var/run/postmaster.pid
 nodbi=0
 dump_cmd=/usr/bin/pg_dump
index b1eb1e9..0cbd602 100644 (file)
@@ -47,7 +47,10 @@ else {
        %displayconfig = %config;
        }
 foreach my $hba (split(/\t+/, $config{'hba_conf'})) {
-       if (-r $hba) {
+       if ($hba =~ /\*|\?/) {
+               ($hba) = glob($hba);
+               }
+       if ($hba && -r $hba) {
                $hba_conf_file = $hba;
                last;
                }
@@ -265,6 +268,15 @@ sub execute_sql_safe
 {
 local $sql = $_[1];
 local @params = @_[2..$#_];
+if ($gconfig{'debug_what_sql'}) {
+       # Write to Webmin debug log
+       local $params;
+       for(my $i=0; $i<@params; $i++) {
+               $params .= " ".$i."=".$params[$i];
+               }
+       &webmin_debug_log('SQL', "db=$_[0] sql=$sql".$params);
+       }
+$sql =~ s/\\/\\\\/g;
 if ($driver_handle &&
     $sql !~ /^\s*(create|drop)\s+database/ && $sql !~ /^\s*\\/ &&
     !$force_nodbi) {