From 39b2c216fdf0d8aab6b3e22538c21f4561850337 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 24 May 2004 14:22:45 +0000 Subject: [PATCH] fix for Bugs: - mail from Thomas Hackl: newest cal upgrades (performance patch) - wiki upgrade probs under postgesql - [ 948279 ] upgrade postgresql 0.9.14-0.9.15 implemented index_names for pgsql db-type (there's no equivalent function in ADOdb) --- phpgwapi/inc/class.db.inc.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.db.inc.php b/phpgwapi/inc/class.db.inc.php index 8955146790..7ff412bf54 100644 --- a/phpgwapi/inc/class.db.inc.php +++ b/phpgwapi/inc/class.db.inc.php @@ -788,8 +788,22 @@ */ function index_names() { - echo "

db::index_names() not yet implemented

\n"; - return array(); + $indices = array(); + if ($this->Type != 'pgsql') + { + echo "

db::index_names() not yet implemented for db-type '$this->Type'

\n"; + return $indices; + } + $this->query("SELECT relname FROM pg_class WHERE NOT relname ~ 'pg_.*' AND relkind ='i' ORDER BY relname"); + while ($this->next_record()) + { + $indices[] = array( + 'index_name' => $this->f(0), + 'tablespace_name' => $this->Database, + 'database' => $this->Database, + ); + } + return $indices; } /**