]> git.joonet.de Git - adminer.git/commitdiff
PostgreSQL: Export DESC indexes (bug #639)
authorJakub Vrana <jakub@vrana.cz>
Sat, 27 Oct 2018 16:14:00 +0000 (18:14 +0200)
committerJakub Vrana <jakub@vrana.cz>
Sat, 27 Oct 2018 16:14:00 +0000 (18:14 +0200)
adminer/drivers/pgsql.inc.php
changes.txt

index fe1f069f2bc0d670a88d691b19ba8202eb961959..36224b7798ee6d6fb8906c8b07e5aac373e5cf12 100644 (file)
@@ -758,7 +758,11 @@ AND typelem = 0"
                // "basic" indexes after table definition
                foreach ($indexes as $index_name => $index) {
                        if ($index['type'] == 'INDEX') {
-                               $return .= "\n\nCREATE INDEX " . idf_escape($index_name) . " ON " . idf_escape($status['nspname']) . "." . idf_escape($status['Name']) . " USING btree (" . implode(', ', array_map('idf_escape', $index['columns'])) . ");";
+                               $columns = array();
+                               foreach ($index['columns'] as $key => $val) {
+                                       $columns[] = idf_escape($val) . ($index['descs'][$key] ? " DESC" : "");
+                               }
+                               $return .= "\n\nCREATE INDEX " . idf_escape($index_name) . " ON " . idf_escape($status['nspname']) . "." . idf_escape($status['Name']) . " USING btree (" . implode(', ', $columns) . ");";
                        }
                }
 
index cebc64eb9901f6f203b9fe76fa02afa9fd5c4987..d76eb9cf4018a9bb32abced677af1a635c77ab45 100644 (file)
@@ -10,6 +10,7 @@ Make maxlength in all fields a soft limit
 MySQL: Support foreign keys created with ANSI quotes (bug #620)
 MySQL: Recognize ON UPDATE current_timestamp() (bug #632, bug #638)
 PostgreSQL: Quote array values in export (bug #621)
+PostgreSQL: Export DESC indexes (bug #639)
 MSSQL: Pass database when connecting
 ClickHouse: Connect, databases list, tables list, select, SQL command
 Georgian translation