Re: LIKE erratic? or unseen DB corruption?

From: "Len Morgan" <len-morgan(at)crcom(dot)net>
To: "Frank Miles" <fpm(at)u(dot)washington(dot)edu>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: LIKE erratic? or unseen DB corruption?
Date: 2001-05-21 15:56:26
Message-ID: 007301c0e20e$a59e2c00$0908a8c0@H233.bstx.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Is it possible that there are spaces after the 'IDC16W' in the field? Try:

LIKE 'IDC16W%'

and see if that makes a difference.

len

>A direct query gets appropriate rows of data:
>
>dbname=# select * from partdef where shpname = 'IDC16W';
> pn_id | class | num | mt | ver | loc_id | unit_id | subptcnt |
shpname | value | descrip
>-------+-------+------+----+-----+--------+---------+----------+-----------
-------+------------+---------
> 17 | 328 | 08X2 | 0 | 0 | | | 1 | IDC16W
| Header-8x2 |
> 11 | 323 | 08X2 | 0 | 0 | | | 1 | IDC16W
| Header-8x2 |
>
>...while the very same query (substituting LIKE for the '=' sign) gets
nothing!?
>
>dbname=# select * from partdef where shpname LIKE 'IDC16W';
> pn_id | class | num | mt | ver | loc_id | unit_id | subptcnt | shpname |
value | descrip
>-------+-------+-----+----+-----+--------+---------+----------+---------+--
-----+---------
>(0 rows)
>

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Denis A. Doroshenko 2001-05-21 16:07:23 Re: psql shell problem
Previous Message Patrick Welche 2001-05-21 15:45:49 Re: psql shell problem