'timestamp with time zone' => 'timestamptz',
);
- $identity_column = min_version(10) ? 'a.attidentity' : '0';
-
- foreach (get_rows("SELECT a.attname AS field, format_type(a.atttypid, a.atttypmod) AS full_type, pg_get_expr(d.adbin, d.adrelid) AS default, a.attnotnull::int, col_description(c.oid, a.attnum) AS comment, $identity_column AS identity
+ foreach (get_rows("SELECT a.attname AS field, format_type(a.atttypid, a.atttypmod) AS full_type, pg_get_expr(d.adbin, d.adrelid) AS default, a.attnotnull::int, col_description(c.oid, a.attnum) AS comment" . (min_version(10) ? ", a.attidentity" : "") . "
FROM pg_class c
JOIN pg_namespace n ON c.relnamespace = n.oid
JOIN pg_attribute a ON c.oid = a.attrelid
$row["type"] = $type;
$row["full_type"] = $row["type"] . $length . $addon . $array;
}
- if (in_array($row['identity'], array('a', 'd'))) {
- $row['default'] = 'GENERATED ' . ($row['identity'] == 'd' ? 'BY DEFAULT' : 'ALWAYS') . ' AS IDENTITY';
+ if (in_array($row['attidentity'], array('a', 'd'))) {
+ $row['default'] = 'GENERATED ' . ($row['attidentity'] == 'd' ? 'BY DEFAULT' : 'ALWAYS') . ' AS IDENTITY';
}
$row["null"] = !$row["attnotnull"];
- $row["auto_increment"] = $row['identity'] || preg_match('~^nextval\(~i', $row["default"]);
+ $row["auto_increment"] = $row['attidentity'] || preg_match('~^nextval\(~i', $row["default"]);
$row["privileges"] = array("insert" => 1, "select" => 1, "update" => 1);
if (preg_match('~(.+)::[^,)]+(.*)~', $row["default"], $match)) {
$row["default"] = ($match[1] == "NULL" ? null : (($match[1][0] == "'" ? idf_unescape($match[1]) : $match[1]) . $match[2]));
Adminer 4.8.1-dev:
Fix more PHP 8 warnings (bug #781)
MySQL: Allow moving views to other DB and renaming DB with views (bug #783)
+PostgreSQL < 10 PDO: Avoid displaying GENERATED ALWAYS BY IDENTITY everywhere (bug #785, regression from 4.7.9)
SQLite: Fix displayed types (bug #784, regression from 4.8.0)
Adminer 4.8.0 (released 2021-02-10):