Re: [SQL] Re: [GENERAL] Determining if "in a text set"

From: Richi Plana <richip(at)mozcom(dot)com>
To: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] Re: [GENERAL] Determining if "in a text set"
Date: 1999-03-28 19:11:54
Message-ID: Pine.LNX.4.04.9903290306380.5417-100000@jaguar.mozcom.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

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(at)mozcom(dot)com `-'-' `-'-' `-'-' `-'-'
------------------------------------------------------------------------
P G P Key available at http://www2.mozcom.com/~richip/richip.asc
Tired of Spam? Join this CAUCE! http://www.cauce.org/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pavel 1999-03-29 05:27:41 unsubscribe
Previous Message Richi Plana 1999-03-28 18:56:04 Re: [GENERAL] Determining if "in a text set"

Browse pgsql-sql by date

  From Date Subject
Next Message Francois TETE 1999-03-29 08:29:28 inheritance and selection
Previous Message Richi Plana 1999-03-28 18:56:04 Re: [GENERAL] Determining if "in a text set"