From 6262b120f525ddfed9844910125e4816b4bd4ee1 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Thu, 6 Mar 2025 18:44:18 +0100 Subject: [PATCH] PostgreSQL: Skip editing generated columns --- adminer/drivers/pgsql.inc.php | 3 ++- changes.txt | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/adminer/drivers/pgsql.inc.php b/adminer/drivers/pgsql.inc.php index 62274c1e..e25dbd58 100644 --- a/adminer/drivers/pgsql.inc.php +++ b/adminer/drivers/pgsql.inc.php @@ -415,7 +415,7 @@ WHERE relkind IN ('r', 'm', 'v', 'f', 'p') 'timestamp with time zone' => 'timestamptz', ); 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" : "") . " + 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" . (min_version(12) ? ", a.attgenerated" : "") : "") . " FROM pg_class c JOIN pg_namespace n ON c.relnamespace = n.oid JOIN pg_attribute a ON c.oid = a.attrelid @@ -441,6 +441,7 @@ ORDER BY a.attnum") as $row if (in_array($row['attidentity'], array('a', 'd'))) { $row['default'] = 'GENERATED ' . ($row['attidentity'] == 'd' ? 'BY DEFAULT' : 'ALWAYS') . ' AS IDENTITY'; } + $row["generated"] = ($row["attgenerated"] == "s"); $row["null"] = !$row["attnotnull"]; $row["auto_increment"] = $row['attidentity'] || preg_match('~^nextval\(~i', $row["default"]); $row["privileges"] = array("insert" => 1, "select" => 1, "update" => 1); diff --git a/changes.txt b/changes.txt index 344f9286..5b7b01bf 100644 --- a/changes.txt +++ b/changes.txt @@ -8,6 +8,7 @@ PostgreSQL: Display ENUM types PostgreSQL: Export ENUM types (bug #587) PostgreSQL: Display ? instead of -1 rows in table overview (bug #883) PostgreSQL: Show accessible databases to non-owners (regression from 4.9.1) +PostgreSQL: Skip editing generated columns PostgreSQL, MS SQL, Oracle: Hide table actions for information_schema SQLite: Support CHECK constraint SQLite: Add command Check tables