Add support for text search functions, feature request #2004429, based on patch from...
authorRobert Treat <xzilla@users.sourceforge.net>
Sat, 12 Jul 2008 05:31:40 +0000 (01:31 -0400)
committerRobert Treat <xzilla@users.sourceforge.net>
Sat, 12 Jul 2008 05:31:40 +0000 (01:31 -0400)
classes/database/Postgres.php
classes/database/Postgres83.php

index 00d18be878774e099f8299569762306f54f3ab0a..e421be6fab505f0212062cab8fb61fef003f1883 100755 (executable)
@@ -4264,6 +4264,9 @@ class Postgres extends ADODB_base {
                                                case 'x':
                                                        $sql .= "\"{$k}\" {$ops[$k]} ({$v})";
                                                        break;
+                                               case 't':
+                                                       $sql .= "\"{$k}\" {$ops[$k]}('{$v}')";
+                                                       break;
                                                default:
                                                        // Shouldn't happen
                                        }
index 14a6f8d9e22ab7a592ce12dc73d4edab1f94251b..e999868b1ff1836b66d952ab6c5e67e172860f2e 100644 (file)
@@ -15,6 +15,16 @@ class Postgres83 extends Postgres82 {
        // Last oid assigned to a system object
        var $_lastSystemOID = 17231; // need to confirm this once we get to beta!!!
 
+       // Select operators
+       var $selectOps = array('=' => 'i', '!=' => 'i', '<' => 'i', '>' => 'i', '<=' => 'i', '>=' => 'i', 
+                                                       '<<' => 'i', '>>' => 'i', '<<=' => 'i', '>>=' => 'i',
+                                                       'LIKE' => 'i', 'NOT LIKE' => 'i', 'ILIKE' => 'i', 'NOT ILIKE' => 'i', 'SIMILAR TO' => 'i',
+                                                       'NOT SIMILAR TO' => 'i', '~' => 'i', '!~' => 'i', '~*' => 'i', '!~*' => 'i',
+                                                       'IS NULL' => 'p', 'IS NOT NULL' => 'p', 'IN' => 'x', 'NOT IN' => 'x',
+                                                       '@@' => 'i', '@@@' => 'i', '@>' => 'i', '<@' => 'i',
+                                                       '@@ to_tsquery' => 't', '@@@ to_tsquery' => 't', '@> to_tsquery' => 't', '<@ to_tsquery' => 't',
+                                                       '@@ plainto_tsquery' => 't', '@@@ plainto_tsquery' => 't', '@> plainto_tsquery' => 't', '<@ plainto_tsquery' => 't');
+
        /**
         * Constructor
         * @param $conn The database connection