On Thu, Sep 29, 2011 at 8:42 PM, David Garfield
wrote:
> If the value in key is a blob, then like matches it and = does not.
Thanks. This suggestion helped me track down the issue. I was actually
going through ActiveRecord (the ORM for Ruby on Rails). Was upgrading
On Thu, Sep 29, 2011 at 08:32:04PM -0400, Eric Anderson scratched on the wall:
> The below statement returns records:
>
> SELECT * FROM recordings WHERE "key" LIKE
> '4df0247ce1a97685a782d2cb051b48ed952e666c';
>
> But this one does not:
>
> SELECT * FROM recordings WHERE "key" =
>
If the value in key is a blob, then like matches it and = does not.
Because like has to do a string conversion on key, it also doesn't use
the index.
Try:
SELECT * FROM recordings WHERE "key" =
cast('4df0247ce1a97685a782d2cb051b48ed952e666c' as blob);
Or try inserting the key as text in the
The below statement returns records:
SELECT * FROM recordings WHERE "key" LIKE
'4df0247ce1a97685a782d2cb051b48ed952e666c';
But this one does not:
SELECT * FROM recordings WHERE "key" =
'4df0247ce1a97685a782d2cb051b48ed952e666c';
The only difference is that = and LIKE have been swapped.
I
4 matches
Mail list logo