diff --git a/adminer/drivers/pgsql.inc.php b/adminer/drivers/pgsql.inc.php index fe1f069f..36224b77 100644 --- a/adminer/drivers/pgsql.inc.php +++ b/adminer/drivers/pgsql.inc.php @@ -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) . ");"; } } diff --git a/changes.txt b/changes.txt index cebc64eb..d76eb9cf 100644 --- a/changes.txt +++ b/changes.txt @@ -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