From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Doug Gorley <dgorley(at)aihs(dot)ca> |
Cc: | "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Zero-length character breaking query? |
Date: | 2012-03-16 13:32:49 |
Message-ID: | 6983.1331904769@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Doug Gorley <dgorley(at)aihs(dot)ca> writes:
> The table is called tdt_unsent. The field is str_name_l. For demonstration purposes, the value is "SMITH".
> "select * from tdt_unsent where str_name_l = 'SMITH'" returns 0 rows.
> "select * from tdt_unsent where str_name_l ~ '^SMITH'" returns 3 rows.
> "select * from tdt_unsent where str_name_l ~ '^SMITH$'" returns 0 rows.
> "select length(str_name_l) from tdt_unsent where str_name_l ~ '^SMITH'" returns "5".
I'd check EXPLAIN (with the actual problematic string, not SMITH).
The planner is probably trying to build an index range condition from
the regex pattern --- is it doing the right thing given your locale?
If the plan looks okay, maybe you need to reindex whatever index it's
using.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2012-03-16 13:36:54 | Re: Problem for restoure data base Postgre |
Previous Message | David Johnston | 2012-03-16 13:16:22 | Re: Zero-length character breaking query? |