using text search

From: Rafał Pietrak <rafal(at)zorro(dot)isa-geek(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: using text search
Date: 2013-04-22 13:15:17
Message-ID: 517537E5.30503@zorro.isa-geek.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

... or not (I'm not quite sure)

Hello,

I have the following tables:

CREATE TABLE orders (info text, ....);
CREATE TABLE keywords (phrase text, .....);

And I need to find all the ORDERS rows, which conain a PHRASE present in
the info column ... like so:
SELECT o.* from orders o join keywords k on (o.info ~~ '%' || k.phrase
|| '%');

... only this does not work, since:
ERROR: argument of JOIN/ON must be type boolean, not type text

is this possible in SQL? Or may be this a job for "ts_something()"
(havent' learned to use them, yet)???

-R

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2013-04-22 13:24:41 Re: Where in the source code does postgres write to disk?
Previous Message Manning John 2013-04-22 10:51:49 Regression test fails v9.2.4