Re: pg_stat_activity

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Pavan Teja <pavan(dot)postgresdba(at)gmail(dot)com>
Cc: Rui DeSousa <rui(dot)desousa(at)icloud(dot)com>, Ron <ronljohnsonjr(at)gmail(dot)com>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: pg_stat_activity
Date: 2018-06-11 17:13:37
Message-ID: CAKFQuwYx=uBJ+=Vn_WuQ81HX0mFrXMLg36xN9vHFohH+U2uYAQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, Jun 11, 2018 at 10:07 AM, Pavan Teja <pavan(dot)postgresdba(at)gmail(dot)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.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Rui DeSousa 2018-06-11 17:50:54 Re: PostgreSQL 'Corruption & Fragmentation' detection and resolution/fix
Previous Message Pavan Teja 2018-06-11 17:07:05 Re: pg_stat_activity