Re: LIKE erratic? or unseen DB corruption?

From: "Gregory Wood" <gregw(at)com-stock(dot)com>
To: "Frank Miles" <fpm(at)u(dot)washington(dot)edu>
Cc: "PostgreSQL-General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: LIKE erratic? or unseen DB corruption?
Date: 2001-05-21 16:44:50
Message-ID: 00b701c0e215$a03b5f10$7889ffcc@comstock.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> A direct query gets appropriate rows of data:
>
> dbname=# select * from partdef where shpname = 'IDC16W';

> ...while the very same query (substituting LIKE for the '=' sign) gets
nothing!?
>
> dbname=# select * from partdef where shpname LIKE 'IDC16W';

> Can someone please tell me the really stupid thing that I'm doing wrong?

Just a guess here... is shpname a CHAR field (which would be padded with
spaces)? If so you'd have to do LIKE 'IDC16W%'

Greg

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Frank Miles 2001-05-21 16:46:03 Re: LIKE erratic? or unseen DB corruption?
Previous Message Richard Huxton 2001-05-21 16:42:49 Re: psql shell problem