]> git.joonet.de Git - adminer.git/commitdiff
Do not cast date/timestamp exact searches in PostgreSQL to text
authorMatěj Humpál <finwe@finwe.info>
Wed, 28 Feb 2018 15:17:12 +0000 (16:17 +0100)
committerJakub Vrana <jakub@vrana.cz>
Thu, 1 Mar 2018 10:06:12 +0000 (11:06 +0100)
adminer/drivers/pgsql.inc.php

index 9b4ce038b8ce935b6f130e7079a45518bb8255dc..638468440c61b8ffe5b579162874697b2771f839 100644 (file)
@@ -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)"
                        );