PostgreSQL: Support JSON and JSONB data types (bug #542)

This commit is contained in:
Jakub Vrana 2017-04-08 19:59:13 +02:00
parent 88803c6d0e
commit 504c56216c
2 changed files with 10 additions and 1 deletions

View 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;
}

View 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