Mike writes:
> 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')
> ,
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 publ
>
>Von: pgsql-general-ow...@postgresql.org
>[pgsql-general-ow...@postgresql.org]" im Auftrag von "Mike
>[m...@wolman.co.uk]
>Gesendet: Mittwoch, 28. Oktober 2015 20:04
>An: pgsql-general@postgresql.org
>Betreff: [GENERA
Hi,
I am trying to clean up the query field returned by the
pg_stat_statements extension and remove all comments.
Some of the queries in the query field contain comments like '-- some
comment' and also '/* c style comments */'
I have managed to strip off the '--' comments and also white spa