find sudstring on text (data type) field failure

From: pantelis vlachos <vlachos83(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: find sudstring on text (data type) field failure
Date: 2012-11-07 08:36:34
Message-ID: CAAYHi_cTqLi9iP_x6_5pV+Jd+wYD2Ak08bF--0oJGk0yqUSUaA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I was trying to find a substring on a text (data type) column like 'cat foo
dog ...'.
I use the query below
SELECT id FROM table WHERE name LIKE '% foo %';
Sometimes the query return with nTuples=0 but there are matching rows.
On retry, the query return with expected results. Any ideas;

(postgres ver 9.2, libpq - C Library)

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message saikiran mothe 2012-11-11 03:13:31 How to compare two tables in PostgreSQL
Previous Message Tom Lane 2012-11-05 15:13:29 Re: Date Index