Skip to content

Commit

Permalink
PostgreSQL: Support JSON and JSONB data types (bug #542)
Browse files Browse the repository at this point in the history
  • Loading branch information
vrana committed Apr 8, 2017
1 parent 88803c6 commit 504c562
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion adminer/drivers/pgsql.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,20 @@ function table($idf) {
}

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) {

This comment has been minimized.

Copy link
@SeinopSys

SeinopSys Apr 8, 2017

This second if looks a bit redundant given the exact same condition is checked in the block just above

This comment has been minimized.

Copy link
@vrana

vrana Apr 8, 2017

Author Owner

Fixed, thanks.

$structured_types[lang('Strings')][] = "jsonb";
$types["jsonb"] = 4294967295;
}
}
}
return $connection;
}
Expand Down
1 change: 1 addition & 0 deletions changes.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 504c562

Please sign in to comment.