Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i3NlE-0004uF-Iz for pgsql-general@arkaria.postgresql.org; Thu, 29 Aug 2019 16:59:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i3NlD-0007k0-2U for pgsql-general@arkaria.postgresql.org; Thu, 29 Aug 2019 16:58:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i3NlC-0007jI-Mo for pgsql-general@lists.postgresql.org; Thu, 29 Aug 2019 16:58:58 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i3NlA-0001bH-Bx for pgsql-general@lists.postgresql.org; Thu, 29 Aug 2019 16:58:58 +0000 Received: by mail-pf1-x432.google.com with SMTP id w2so2473114pfi.3 for ; Thu, 29 Aug 2019 09:58:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=pYhkV6rUu2W8wIb8Y1w/V3Y6aPjnSpSDseQigDZ/Abg=; b=GkhD2EuQ0vuT8NO3q0bA3SoLkqo4I5+zOFu/9WtLJHHNrXNY2XF3BoIJaNyyktzVAB 7CRG88MHhKqkSowQt+vjSxSYNOpU/umB1waXuUBC3fuhatt82/ufRBwbWZXpZzkVNC0Z xK2FrO1oYvPmQxFc0t3wcHXDb7rmVnmAIBVBAF2kRkD8s+HiNUobfXVyp3EBCQDG0XLI 6q4v8MTHL39idTjNbaqsYsDR/TBcD9/4lQa8owhn/wFLrURpvlOu501lBlutAD/xRQq6 fL8yaqgL5OlDZK/cLeqaD3Ik6PKLR/OPBcEtUw9fRY0TEyX5QY3brWbrt5HD4ZRu+JyX Vk0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=pYhkV6rUu2W8wIb8Y1w/V3Y6aPjnSpSDseQigDZ/Abg=; b=HVTD2qGyAINp0Frj5/ger6suYFXXNL9aAJNTbXp6B8T19lW+U63NgF6ko6QCRium6N xeH+e2xEWxCcTAbHbLZjZULA6r8RIKJaloxdpBh/OUe91Ui8TmTIYljCrkwKbPavqfKu aT55OpwGWIs7JD/m2+Pj8vka7riKOLQP7sbxiBtjjxWdQNvZhCtrCbtzffJJB4FuJaJR gmMVgby+2HuKS+hj4dbvQOSMtOquBFSC03xKJ7jyV0QC2ySQm9OWMtZyDR2DzjhmYRD9 CyQ5MzwJXLVh7VVpCHjpMYYAGOHxE+OZmacE9QXG7rkrskyanV/ZLaLU/nmOudbtIWI3 BH7A== X-Gm-Message-State: APjAAAXsBp/BU4H9gTufp9V64V0+E/4mrHb7HHSo2tiGKtnPHjAwbnEh uUPVYO8VctRDlWJTpUkyqAZS1FxC X-Google-Smtp-Source: APXvYqw36xaSP/8P2H59ggWnJNm8xp0W1axnfjxwO4FqH5xtnWs0r55rSMO3l8iipw/c9J4OyI6Rzw== X-Received: by 2002:a17:90a:b946:: with SMTP id f6mr11080898pjw.86.1567097933700; Thu, 29 Aug 2019 09:58:53 -0700 (PDT) Received: from [10.104.134.41] ([155.100.47.1]) by smtp.gmail.com with ESMTPSA id a1sm2488904pgh.61.2019.08.29.09.58.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Aug 2019 09:58:53 -0700 (PDT) Subject: Re: Query using 'LIKE' returns empty set To: pgsql-general@lists.postgresql.org References: From: Rob Sargent Message-ID: <35011785-7cb6-59a7-550f-24b8ff6e9a0a@gmail.com> Date: Thu, 29 Aug 2019 10:58:52 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 8/29/19 10:39 AM, Rich Shepard wrote: > 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 > > Are you sure that particular file has the search string? grep -i nehalem fish_counts