pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: CREATE OR REPLACE FUNCTION statement just sitting there
Date: Tue, 6 Nov 2018 06:28:26 -0600
Message-ID: <a8ff2df8-475a-2443-78ac-9d81198d734a@gmail.com> (raw)
In-Reply-To: <20181106113429.eckik5dtmspck4lz@alvherre.pgsql>
References: <20181106113429.eckik5dtmspck4lz@alvherre.pgsql>

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=52f5d578d6c29bf254e93c69043b817d4047c...
> ?  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.

view thread (8+ messages)  latest in thread

Message-ID: <a8ff2df8-475a-2443-78ac-9d81198d734a@gmail.com>
Permalink:  ../a8ff2df8-475a-2443-78ac-9d81198d734a@gmail.com/
Also on:    postgresql.org/message-id/a8ff2df8-475a-2443-78ac-9d81198d734a@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ronljohnsonjr@gmail.com
  Subject: Re: CREATE OR REPLACE FUNCTION statement just sitting there
  In-Reply-To: <a8ff2df8-475a-2443-78ac-9d81198d734a@gmail.com>
  References: <20181106113429.eckik5dtmspck4lz@alvherre.pgsql> <a8ff2df8-475a-2443-78ac-9d81198d734a@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox