Re: How to view the activity of postgresql - Mailing list pgsql-novice

From richard@xentu.com
Subject Re: How to view the activity of postgresql
Date
Msg-id cf1a8830bffe586bec4fb04550dcd2c1@xentu.com
Whole thread Raw
In response to Re: How to view the activity of postgresql  (Keith <keith@foresightweb.net>)
Responses Re: How to view the activity of postgresql
List pgsql-novice
On 2016-04-28 13:50, Keith wrote:
> On Apr 28, 2016 2:42 AM, <richard@xentu.com> wrote:
>>
>> On 2016-04-28 07:18, Wei Shan wrote:
>>>
>>> you can try pgbadger.
>>>
>>> https://github.com/dalibo/pgbadger [1] [3]
>>>
>>>
>>> On 28 April 2016 at 14:13, <richard@xentu.com> wrote:
>>>
>>>> I want to see what statements are being executed on a remote
>>>> postgresql server, ideally in a scrolling display in some gui
> tool.
>>>> In MSSQL, there is a profiler application that gives this.
>>>>
>>>> The best I've found so far is to set postgresql to log to a csv
> file
>>>> & then use pg_read_file to periodically read the log file &
> display
>>>> it to the user.
>>>>
>>>> I've written a little tool that does that:
>>>> http://www.xentu.com/pgprofiler/ [2] [1]
>>>>
>>>>
>>>> However, it seems a very akward way to achieve what I'm looking
> for
>>>> and will probably slow the server with all the file reading &
>>>> writing involved.
>>>>
>>>> Is there a more efficient way of doing this?
>>>>
>>>> --
>>>> Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
>>>> To make changes to your subscription:
>>>> http://www.postgresql.org/mailpref/pgsql-novice [3] [2]
>>>
>>>
>>> --
>>>
>>> Regards,
>>> Ang Wei Shan
>>>
>>
>> Thanks Ang,
>>
>> As far as I can see, this is a postmortum analysis of the log files.
> I want to somehow see the statements as they get received by the
> server, as if I were tailing the log file.
>>
>> Regards
>> Richard
>>
>>
>>
>> --
>> Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-novice [3]
>
> Check out pg_activity
>
> https://github.com/julmon/pg_activity [4]
>
> Keith
>

Thanks Keith,

Have you actually got pg_activity working? I gave up trying to install
it on xp, but have done so on my Ubuntu machine, but when I try to
connect to a remote postgresql server, I get an error:

$ pg_activity -U postgres -h myserver.com
FATAL: password authentication failed for user "postgres"

I'm offered no opportunity to enter the postgres user's password and
there seems to be no command line option to supply it.

 From this location, I can certainly connect to the remote server as
postgres, in fact I've got pgAdmin installed on this machine that is set
up to do just that.

workstation:
   Ubuntu 14.04
   pg_activity 1.1.1
server:
   Windows Server 2012 R2.
   postgresql 9.4.5


Richard



pgsql-novice by date:

Previous
From: Shmagi Kavtaradze
Date:
Subject: cosine function
Next
From: richard@xentu.com
Date:
Subject: Re: How to view the activity of postgresql