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; } /**