Re: find sudstring on text (data type) field failure

From: Craig Ringer <craig(at)2ndQuadrant(dot)com>
To: pantelis vlachos <vlachos83(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: find sudstring on text (data type) field failure
Date: 2012-11-11 10:24:23
Message-ID: 509F7CD7.1080009@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 11/07/2012 04:36 PM, pantelis vlachos wrote:
> 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)

Nowhere near enough information. I'd say you have concurrency issues; at
the time you ran the query there weren't actually matching rows. See if
you can put together a test case that demonstrates the issue, or follow
up with a lot more detail.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Rob Sargentg 2012-11-12 07:23:10 Re: How to compare two tables in PostgreSQL
Previous Message saikiran mothe 2012-11-11 03:13:31 How to compare two tables in PostgreSQL