Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6T1K-00028L-6c for pgsql-sql@arkaria.postgresql.org; Tue, 15 Nov 2016 01:58:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c6T1J-0007C4-Gx for pgsql-sql@arkaria.postgresql.org; Tue, 15 Nov 2016 01:58:45 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c6T0L-00066z-6r for pgsql-sql@postgresql.org; Tue, 15 Nov 2016 01:57:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c6T0I-00033j-Pl for pgsql-sql@postgresql.org; Tue, 15 Nov 2016 01:57:44 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id uAF1vefQ024698; Mon, 14 Nov 2016 20:57:40 -0500 From: Tom Lane To: Michael Moore cc: postgres list Subject: Re: Only target lines of text In-reply-to: References: Comments: In-reply-to Michael Moore message dated "Mon, 14 Nov 2016 17:19:17 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <24696.1479175060.1@sss.pgh.pa.us> Date: Mon, 14 Nov 2016 20:57:40 -0500 Message-ID: <24697.1479175060@sss.pgh.pa.us> X-Pg-Spam-Score: -4.7 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org Michael Moore writes: > how can I change this so that it only shows me the lines of text containing > the matching string? > SELECT > proname AS functionname, > prosrc AS source > FROM > pg_proc > WHERE > prosrc ~* 'ypoi_db'; You mean you just want part of each prosrc entry? Try something like select * from (select proname, unnest(string_to_array(prosrc, '\n')) as l from pg_proc) ss where l ~* 'ypoi_db'; regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql