Ticket #3254: fts-pstgres.patch

File fts-pstgres.patch, 711 bytes (added by rachid, 7 years ago)

corrected Patch (only for postgres)

  • base.py

     
    3030        # http://www.initd.org/tracker/psycopg/wiki/psycopg2_documentation#postgresql-status-message-and-executed-query
    3131        return cursor.query
    3232
     33    def unquote_name(self, name):
     34        return name.strip('"')
     35
     36    def fulltext_search_sql(self, field_name):
     37        requoted_field_name = self.quote_name("%s_tsv" % (self.unquote_name(field_name)))
     38        return "%s @@ to_tsquery(%%s)" % requoted_field_name
     39
    3340class DatabaseWrapper(BaseDatabaseWrapper):
    3441    features = DatabaseFeatures()
    3542    ops = DatabaseOperations()
Back to Top