agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Moore <michaeljmoore@gmail.com>
Cc: postgres list <pgsql-sql@postgresql.org>
Subject: Re: Only target lines of text
Date: Mon, 14 Nov 2016 20:57:40 -0500
Message-ID: <24697.1479175060@sss.pgh.pa.us> (raw)
In-Reply-To: <CACpWLjNu491rbpoyUPFbjV2yYx3QErmaBCnNNOCL1S=6jtYgSw@mail.gmail.com>
References: <CACpWLjNu491rbpoyUPFbjV2yYx3QErmaBCnNNOCL1S=6jtYgSw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>

Michael Moore <michaeljmoore@gmail.com> 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



view thread (7+ messages)  latest in thread

Message-ID: <24697.1479175060@sss.pgh.pa.us>
Permalink:  ../24697.1479175060@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24697.1479175060@sss.pgh.pa.us

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, michaeljmoore@gmail.com
  Subject: Re: Only target lines of text
  In-Reply-To: <24697.1479175060@sss.pgh.pa.us>

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

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