From f8288dd227180977dcc9d147922f6c77e343488a Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sat, 6 Feb 2021 18:01:24 +0100 Subject: [PATCH] PostgreSQL 11: Create PRIMARY KEY for auto increment columns --- adminer/drivers/pgsql.inc.php | 2 +- changes.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/adminer/drivers/pgsql.inc.php b/adminer/drivers/pgsql.inc.php index 98e5974f..f3c880b2 100644 --- a/adminer/drivers/pgsql.inc.php +++ b/adminer/drivers/pgsql.inc.php @@ -491,7 +491,7 @@ ORDER BY connamespace, conname") as $row) { } function auto_increment() { - return ""; + return (min_version(11) ? " PRIMARY KEY" : ""); } function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) { diff --git a/changes.txt b/changes.txt index a731bc3c..62a296ad 100644 --- a/changes.txt +++ b/changes.txt @@ -8,6 +8,7 @@ PostgreSQL: Do not show view definition from other schema (PR #392) PostgreSQL: Use bigserial for bigint auto increment (bug #765, regression from 3.0.0) PostgreSQL PDO: Support PgBouncer, unsupport PostgreSQL < 9.1 (bug #771) PostgreSQL 10: Support GENERATED ALWAYS BY IDENTITY (PR #386) +PostgreSQL 11: Create PRIMARY KEY for auto increment columns MS SQL: Don't truncate comments to 30 chars (PR #376) Editor: Cast to string when searching (bug #325) Re-enable PHP warnings (regression from 4.7.8)