pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rich Shepard <rshepard@appl-ecosys.com>
To: pgsql-general@lists.postgresql.org
Subject: Query using 'LIKE' returns empty set
Date: Thu, 29 Aug 2019 09:39:24 -0700 (PDT)
Message-ID: <alpine.LNX.2.20.1908290903030.2953@salmo.appl-ecosys.com> (raw)

Next problem is one I've not before encountered.

The .sql file used to import data to the fish_counts table has rows such as
this one:

('1237796458250','0','17174','Buchanan Creek','Buchanan Creek trib to North
Fork Nehalem River','0-3.25','161980','Unknown','Jack or subadult','Peak
live & dead fish','Spawner Counts','ODFW','2012-01-06','1950-1974',25,
'1950-10-01','1951-01-31','Ground','Actual Physical Counts',0), 
[Lines wrapped in the message only.]

When I submit this query I get no rows returned:

select * from fish_counts where stream_tribs ilike 'Nehalem';
  count_id | loc_id | downstream | upstream | stream_name | stream_tribs | r
iver_miles | itis_tsn | production | life_stage | count_type | data_categor
y | compiled_by | updated | years | nbr_observations | begin_date | end_dat
e | sample_method | calc_method | count_value 
----------+--------+------------+----------+-------------+--------------+--
-----------+----------+------------+------------+------------+-------------
--+-------------+---------+-------+------------------+------------+--------
--+---------------+-------------+-------------
(0 rows)

What is equally puzzling is when I search the input file using
 	grep -c -e "Nehalem" fish_counts
0 is returned, the same as the postgres query.

I want to understand what I've done incorrectly.

TIA,

Rich





view thread (3+ messages)  latest in thread

Message-ID: <alpine.LNX.2.20.1908290903030.2953@salmo.appl-ecosys.com>
Permalink:  ../alpine.LNX.2.20.1908290903030.2953@salmo.appl-ecosys.com/
Also on:    postgresql.org/message-id/alpine.LNX.2.20.1908290903030.2953@salmo.appl-ecosys.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: rshepard@appl-ecosys.com
  Subject: Re: Query using 'LIKE' returns empty set
  In-Reply-To: <alpine.LNX.2.20.1908290903030.2953@salmo.appl-ecosys.com>
  References: <alpine.LNX.2.20.1908290903030.2953@salmo.appl-ecosys.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox