From: Matěj Humpál Date: Wed, 28 Feb 2018 15:17:12 +0000 (+0100) Subject: Do not cast date/timestamp exact searches in PostgreSQL to text X-Git-Tag: v4.6.3~50 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=f844fc499e134c460b174df07bdb89de6e60987e;p=adminer.git Do not cast date/timestamp exact searches in PostgreSQL to text --- diff --git a/adminer/drivers/pgsql.inc.php b/adminer/drivers/pgsql.inc.php index 9b4ce038..63846844 100644 --- a/adminer/drivers/pgsql.inc.php +++ b/adminer/drivers/pgsql.inc.php @@ -194,7 +194,10 @@ if (isset($_GET["pgsql"])) { } function convertSearch($idf, $val, $field) { - return (preg_match('~char|text' . (is_numeric($val["val"]) && !preg_match('~LIKE~', $val["op"]) ? '|' . number_type() : '') . '~', $field["type"]) + return (preg_match('~char|text' + . (is_numeric($val["val"]) && !preg_match('~LIKE~', $val["op"]) ? '|' . number_type() : '') + . (!preg_match('~LIKE~', $val["op"]) ? '|date|timestamp' : '') + . '~', $field["type"]) ? $idf : "CAST($idf AS text)" );