Re: Only target lines of text

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Only target lines of text
Дата
Msg-id 24697.1479175060@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Only target lines of text  (Michael Moore <michaeljmoore@gmail.com>)
Ответы Re: Only target lines of text
Список pgsql-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



В списке pgsql-sql по дате отправления:

Предыдущее
От: Rob Sargent
Дата:
Сообщение: Re: Only target lines of text
Следующее
От: Michael Moore
Дата:
Сообщение: Re: Only target lines of text