Sometimes, the developers add comments to the top of statements, and so we
see that in pg_stat_activity.query as seen in this example:
select query
from pg_stat_activity
where pid = 1054079;
query
----------------------------------------
-- Some comment written by the developer
SELECT blah blah FROM .blah
I could case-insensitively search pg_stat_activity.query for "SELECT " but
that will fail if there is a SELECT in the CTE or subquery of a DELETE or
UPDATE statement, and writing a parser to strip out all comments is a bit
too much effort for a simple query.
--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!