Index: openacs-4/packages/tsearch2-driver/tcl/tsearch2-driver-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tsearch2-driver/tcl/tsearch2-driver-procs-postgresql.xql,v diff -u -r1.10 -r1.10.2.1 --- openacs-4/packages/tsearch2-driver/tcl/tsearch2-driver-procs-postgresql.xql 2 Apr 2013 11:05:18 -0000 1.10 +++ openacs-4/packages/tsearch2-driver/tcl/tsearch2-driver-procs-postgresql.xql 27 Nov 2014 09:48:52 -0000 1.10.2.1 @@ -52,8 +52,7 @@ from [join $from_clauses ","] $base_query - [expr {[llength $where_clauses] > 0 ? " and " : ""}] - [join $where_clauses " and "] + [expr {[llength $where_clauses] > 0 ? " and [join $where_clauses { and }]" : ""}] order by ts_rank(fti,to_tsquery(:query)) desc ), :user_id, 'read') $limit_clause $offset_clause @@ -67,8 +66,7 @@ from [join $from_clauses ","] $base_query - [expr {[llength $where_clauses] > 0 ? " and " : ""}] - [join $where_clauses " and "] + [expr {[llength $where_clauses] > 0 ? " and [join $where_clauses { and }]" : ""}]