From: Richi Plana <richip@mozcom.com>
To: Herouth Maoz <herouth@oumail.openu.ac.il>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] Re: [GENERAL] Determining if "in a text set"
Date: Mon, 29 Mar 1999 03:11:54 +0800 (JST)
Message-ID: <Pine.LNX.4.04.9903290306380.5417-100000@jaguar.mozcom.com> (raw)
In-Reply-To: <Pine.LNX.4.04.9903290235290.5417-100000@jaguar.mozcom.com>
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/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: richip@mozcom.com, herouth@oumail.openu.ac.il
Subject: Re: [SQL] Re: [GENERAL] Determining if "in a text set"
In-Reply-To: <Pine.LNX.4.04.9903290306380.5417-100000@jaguar.mozcom.com>
References: <Pine.LNX.4.04.9903290235290.5417-100000@jaguar.mozcom.com> <Pine.LNX.4.04.9903290306380.5417-100000@jaguar.mozcom.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox