]> git.joonet.de Git - adminer.git/commitdiff
PostgreSQL: Support JSON and JSONB data types (bug #542)
authorJakub Vrana <jakub@vrana.cz>
Sat, 8 Apr 2017 17:59:13 +0000 (19:59 +0200)
committerJakub Vrana <jakub@vrana.cz>
Sat, 8 Apr 2017 17:59:13 +0000 (19:59 +0200)
adminer/drivers/pgsql.inc.php
changes.txt

index 9f47cc4566daf6039ba31f3f3d37ec0177d0960b..99733a468246b7f489ff49856bd697a5a4e67f34 100644 (file)
@@ -186,12 +186,20 @@ if (isset($_GET["pgsql"])) {
        }
 
        function connect() {
-               global $adminer;
+               global $adminer, $types, $structured_types;
                $connection = new Min_DB;
                $credentials = $adminer->credentials();
                if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
                        if ($connection->server_info >= 9) {
                                $connection->query("SET application_name = 'Adminer'");
+                               if ($connection->server_info >= 9.2) {
+                                       $structured_types[lang('Strings')][] = "json";
+                                       $types["json"] = 4294967295;
+                                       if ($connection->server_info >= 9.2) {
+                                               $structured_types[lang('Strings')][] = "jsonb";
+                                               $types["jsonb"] = 4294967295;
+                                       }
+                               }
                        }
                        return $connection;
                }
index cceb5bc4f978fdd160a41095e878afd6729c87eb..ffbd04c2273fdeaaceec3654eb9c3d1949fb7dc2 100644 (file)
@@ -1,6 +1,7 @@
 Adminer 4.3.1-dev:
 PostgreSQL: Fix index size computation in PostgreSQL < 9.0 (regression from 4.3.0)
 PostgreSQL: Fix nullable fields in export
+PostgreSQL: Support JSON and JSONB data types
 
 Adminer 4.3.0 (released 2017-03-15):
 Make maxlength in edit fields a soft limit