Re: CREATE OR REPLACE FUNCTION statement just sitting there

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: CREATE OR REPLACE FUNCTION statement just sitting there
Date: 2018-11-06 12:28:26
Message-ID: a8ff2df8-475a-2443-78ac-9d81198d734a@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/06/2018 05:34 AM, Alvaro Herrera wrote:
> On 2018-Nov-05, Ron wrote:
>
>> That (plus pg_locks)  is the heart of the "list all blocking queries"
>> statement I copied from https://wiki.postgresql.org/wiki/Lock_Monitoring.
> On that page there's a note about 9.6. Did you see the referenced
> commit
> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=52f5d578d6c29bf254e93c69043b817d4047ca67
> ? Maybe see about using the "pg_blocking_pids(int) returns int[]"
> function instead.

I did see it, but the https://wiki.postgresql.org/wiki/Lock_Monitoring query
seems to work (seeing that it regularly shows locks).

Is this query from https://stackoverflow.com/a/43363536/1543618 adequate to
the task?

|selectpid,usename,pg_blocking_pids(pid)asblocked_by,query asblocked_query
frompg_stat_activity wherecardinality(pg_blocking_pids(pid))>0;|

--
Angular momentum makes the world go 'round.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2018-11-06 13:35:57 Re: CREATE OR REPLACE FUNCTION statement just sitting there
Previous Message Ron 2018-11-06 12:18:31 Re: CREATE OR REPLACE FUNCTION statement just sitting there