Re: pg_stat_activity - Mailing list pgsql-admin

From David G. Johnston
Subject Re: pg_stat_activity
Date
Msg-id CAKFQuwYx=uBJ+=Vn_WuQ81HX0mFrXMLg36xN9vHFohH+U2uYAQ@mail.gmail.com
Whole thread Raw
In response to Re: pg_stat_activity  (Pavan Teja <pavan.postgresdba@gmail.com>)
Responses Re: pg_stat_activity
Re: pg_stat_activity
List pgsql-admin
On Mon, Jun 11, 2018 at 10:07 AM, Pavan Teja <pavan.postgresdba@gmail.com> wrote:
You can use LIKE  operator for getting updates and deletes and inserts like 

​I was pondering whether answering "show me everything that isn't (match non-select statements) would be more easily achievable...and in fact it is but...
" Select * from pg_stat_activity where query like '%UPDATE%' or '%update%' "

The same in case of updates and deletes.

That would depend on how acceptable false positives are...​generally speaking pattern matching the input string doesn't work reliably.

  You can also configure table level audit with the help of triggers to capture DML's 

​How?

David J.

pgsql-admin by date:

Previous
From: Pavan Teja
Date:
Subject: Re: pg_stat_activity
Next
From: Rui DeSousa
Date:
Subject: Re: PostgreSQL 'Corruption & Fragmentation' detection andresolution/fix