Re: Any way to see what queries are currently running? - Mailing list pgsql-admin

From adey
Subject Re: Any way to see what queries are currently running?
Date
Msg-id 1c66bda80508152107a29330e@mail.gmail.com
Whole thread Raw
In response to Any way to see what queries are currently running?  (Chris Hoover <revoohc@gmail.com>)
Responses Re: Any way to see what queries are currently running?
List pgsql-admin
You could try the following query after enabling the
stats_command_string parameter in the postgresql.conf file:-

-- displays current activity in the database
-- postgresql.conf parameter stats_command_string populates the
current_query -- column


select     datid,

    datname as "DB Name",

    substr(procpid,1,6) as "Procpid",

    substr(usesysid,1,5),

    usename,

    current_query as SQL,

    query_start

from

    pg_stat_activity

order by

    procpid

On 8/16/05, Chris Hoover <revoohc@gmail.com> wrote:
> I'm running 7.3.4.  Is there anyway to see the actual sql being run by
> the database via a query?  I am having some problems with long running
> load causing querires from our reporting system.  I have sql logging
> turned on to log the sql statements to my postgres.log file.  However,
> these reporting queries do not appear to be logging the entire query.
> I am only getting the select clause (and I'm not sure if it's all of
> it) but no from or where clause.
>
> Can I pull these queries out from postgres?
>
> Thanks,
>
> Chris
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>

pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: Any way to see what queries are currently running?
Next
From: Tom Lane
Date:
Subject: Re: Any way to see what queries are currently running?