Revert r45821, r45830, r45831 and r45835 all in order to revert r45819, per discussio...
[lhc/web/wiklou.git] / includes / db / DatabasePostgres.php
index dec0284..f8c0eb5 100644 (file)
@@ -698,7 +698,7 @@ class DatabasePostgres extends Database {
                        return NULL;
                }
                while ( $row = $this->fetchObject( $res ) ) {
-                       if ( $row->indexname == $index ) {
+                       if ( $row->indexname == $this->indexName( $index ) ) {
                                return $row;
                        }
                }
@@ -708,7 +708,7 @@ class DatabasePostgres extends Database {
        function indexUnique ($table, $index, $fname = 'Database::indexUnique' ) {
                $sql = "SELECT indexname FROM pg_indexes WHERE tablename='{$table}'".
                        " AND indexdef LIKE 'CREATE UNIQUE%(" . 
-                       $this->strencode( $index ) .
+                       $this->strencode( $this->indexName( $index ) ) .
                        ")'";
                $res = $this->query( $sql, $fname );
                if ( !$res )