Received: from copycat.mozcom.com ([205.136.46.9]) by hub.org (8.9.2/8.9.1) with ESMTP id OAA83215 for ; Sun, 28 Mar 1999 14:15:10 -0500 (EST) (envelope-from richip@mozcom.com) Received: from jaguar (jaguar.mozcom.com [202.47.132.75]) by copycat.mozcom.com (8.9.3/8.9.3) with ESMTP id DAA14436; Mon, 29 Mar 1999 03:11:54 +0800 (HKT) Date: Mon, 29 Mar 1999 03:11:54 +0800 (JST) From: Richi Plana To: Herouth Maoz cc: pgsql-sql@postgreSQL.org Subject: Re: [SQL] Re: [GENERAL] Determining if "in a text set" In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, On Mon, 29 Mar 1999, Richi Plana wrote: |o| |o| SELECT * FROM {class} |o| |o| WHERE '{phrase}' ~ ' ' || ( rtrim( FieldN ) || '$' ) |o| |o| OR '{phrase}' ~ '^' || ( rtrim( FieldN ) || ' ' ) |o| |o| OR '{phrase}' ~ ' ' || ( rtrim( FieldN ) || ' ' ) |o| |o| OR '{phrase}' = rtrim( FieldN ); |o| |o| 3) When I try the concat strings operator (||), I get the following psql |o| error: |o| |o| ERROR: parser: syntax error at or near "||" My mistake. I didn't take into account hierarchy/precedence of operators. It seems string concatenation (||) has a higher order compared to the regex and LIKE operators. It should have been. SELECT * FROM {class} WHERE '{phrase}' ~ ('^' || TRIM(FieldN) ...' L L Richi Plana 8^) ,-,-. ,-,-. ,-,-. ,-,-. ,- LL LL Systems Administrator / / \ \ / / \ \ / / \ \ / / \ \ / / LLLLL Mosaic Communications, Inc. \ \ / / \ \ / / \ \ / / \ \ / / LLLLL mailto:richip@mozcom.com `-'-' `-'-' `-'-' `-'-' ------------------------------------------------------------------------ P G P Key available at http://www2.mozcom.com/~richip/richip.asc Tired of Spam? Join this CAUCE! http://www.cauce.org/