]> git.nbdom.net Git - nb.git/commitdiff
lib/php/db/table.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 3 Jul 2018 03:21:33 +0000 (04:21 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 3 Jul 2018 03:21:33 +0000 (04:21 +0100)
lib/php/db/table.php
lib/php/db/types/pgsql.php

index 9e137de026bf3a6e5efcac70849eab81b698ed09..8da63d3843c7d49d9d097ca1f9cd5607579d4bfb 100644 (file)
@@ -778,6 +778,9 @@ Class Table extends nb {
                $regexp = $this->db()->conf_type('regexp');
                if (empty($regexp)) $regexp = 'REGEXP';
 
+               $regexp_not = $this->db()->conf_type('regexp_not');
+               if (empty($regexp_not)) $regexp_not = 'NOT ';
+
                foreach ($this->fields() as $k => $field) {
 
                        // No empty values
@@ -802,7 +805,7 @@ Class Table extends nb {
                                $match = 'regexp';
                                $v = substr($v,1);
                                $v = $this->db()->quote($v);
-                               $equal = ' '.($not ? 'NOT ' : '').$regexp.' ';
+                               $equal = ' '.($not ? $regexp_not : '').$regexp.' ';
 
                        } elseif ($field->string()) {
 
index 804c2a0c87e301854d18556ad1999c79f40c796c..e2e3bbe018f2b3cd2491d83984a8c90d47262354 100644 (file)
@@ -18,6 +18,7 @@ $DB_TYPES['pgsql'] = array (
 'cast_text' => function($name) { return "$name::text"; },
 'extra_where' => 'denorm',
 'regexp' => '~',
+'regexp_not' => '!',
 'quote_field' => function($str) { $chr = "'"; $str = str_replace($chr,$chr.$chr,$str); return $chr . $str . $chr; },
 
 'localFile' => array (getenv('HOME').'/.pgpass','^[^:]+:[^:]+:<D.NAME>:(?P<user>[^:]+):(?<password>[^:]+)'),