From: Greg Sabino Mullane Date: Mon, 28 Aug 2006 02:49:12 +0000 (+0000) Subject: Tighten up tableExists SQL, fix hyperlink to tsearch2 docs. X-Git-Tag: 1.31.0-rc.0~55893 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/journal.php?a=commitdiff_plain;h=44c979907579f4b3f5ebeddae6bd17593896f202;p=lhc%2Fweb%2Fwiklou.git Tighten up tableExists SQL, fix hyperlink to tsearch2 docs. --- diff --git a/includes/DatabasePostgres.php b/includes/DatabasePostgres.php index 50097b89bc..f96d931c53 100644 --- a/includes/DatabasePostgres.php +++ b/includes/DatabasePostgres.php @@ -162,7 +162,7 @@ class DatabasePostgres extends Database { print "
  • Checking that tsearch2 is installed in the database \"$wgDBname\"..."; if (! $this->tableExists("pg_ts_cfg", $wgDBts2schema)) { print "FAILED. tsearch2 must be installed in the database \"$wgDBname\"."; - print "Please see 'http://www.devx.com/opensource/Article/21674/0/page/2'>this article"; + print "Please see this article"; print " for instructions or ask on #postgresql on irc.freenode.net
  • \n"; dieout(""); } @@ -657,7 +657,8 @@ class DatabasePostgres extends Database { $etable = preg_replace("/'/", "''", $table); $eschema = preg_replace("/'/", "''", $schema); $SQL = "SELECT 1 FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n " - . "WHERE c.relnamespace = n.oid AND c.relname = '$etable' AND n.nspname = '$eschema'"; + . "WHERE c.relnamespace = n.oid AND c.relname = '$etable' AND n.nspname = '$eschema' " + . "AND c.relkind IN ('r','v')"; $res = $this->query( $SQL ); $count = $res ? pg_num_rows($res) : 0; if ($res)