Re: regexp_replace to remove sql comments

Поиск
Список
Период
Сортировка
От Mike
Тема Re: regexp_replace to remove sql comments
Дата
Msg-id 5631531A.2030305@wolman.co.uk
обсуждение исходный текст
Ответ на Re: regexp_replace to remove sql comments  (Marc Mamin <M.Mamin@intershop.de>)
Ответы Re: regexp_replace to remove sql comments
Список pgsql-general
Thanks with a bit of moving stuff about I think thats sorted it - in
case anyone every needs it:

   SELECT
    query,
      trim(regexp_replace(
         regexp_replace(
            regexp_replace(query,'\/\*.+\*\/','','g'),
         '--[^\r\n]*', ' ', 'g')
      , '\s+', ' ', 'g')) as q
    FROM public.pg_stat_statements
    WHERE dbid IN (SELECT oid FROM pg_database WHERE datname =
  current_database())

  order by query

Thanks again,

Mike.

On 28/10/2015 22:43, Marc Mamin wrote:
> ', '\/\*.+\*\/','','g'):



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

Предыдущее
От: Marc Mamin
Дата:
Сообщение: Re: regexp_replace to remove sql comments
Следующее
От: Tom Lane
Дата:
Сообщение: Re: regexp_replace to remove sql comments