diff --git a/VERSION b/VERSION index 3ba35bcf..45d8fe86 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.4.1-alpha.2+timestamp.2013.01.18.09.08.52 +Version 2.4.1-alpha.2+timestamp.2013.01.18.09.13.47 diff --git a/gluon/dal.py b/gluon/dal.py index b686d6f5..72a135fe 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -2570,12 +2570,18 @@ class PostgreSQLAdapter(BaseAdapter): def LIKE(self,first,second): - return '(%s LIKE %s)' % (self.expand(first), - self.expand(second,'string')) + args = (self.expand(first), self.expand(second,'string')) + if not first.type in ('string', 'text', 'json'): + return '(CAST(%s AS CHAR) LIKE %s)' % args + else: + return '(%s LIKE %s)' % args def ILIKE(self,first,second): - return '(%s ILIKE %s)' % (self.expand(first), - self.expand(second,'string')) + args = (self.expand(first), self.expand(second,'string')) + if not first.type in ('string', 'text', 'json'): + return '(CAST(%s AS CHAR) ILIKE %s)' % args + else: + return '(%s ILIKE %s)' % args def REGEXP(self,first,second): return '(%s ~ %s)' % (self.expand(first),