find sudstring on text (data type) field failure
find sudstring on text (data type) field failure
От:
pantelis vlachos <vlachos83@gmail.com>
Дата:
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)
Re: find sudstring on text (data type) field failure
От:
Craig Ringer <craig@2ndQuadrant.com>
Дата:
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.
Re: find sudstring on text (data type) field failure
От:
Achilleas Mantzios <achill@smadev.internal.net>
Дата:
Gia sou Panteli,
are you suggesting that the results are incinsistent and unpredictable with every run?
pls present a case demontsrating the problem.
On Τετ 07 Νοε 2012 10:36:34 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)
-
Achilleas Mantzios
IT DEPT