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:18:31 -0600
Message-ID: <02bf9cee-b94a-5eff-36a4-036f29458003@gmail.com> (raw)
In-Reply-To: <fd838055fc92c0ee0a630ba5ccf181c0dea31051.camel@cybertec.at>
References: <924318ab-f639-8116-e3a4-af4890dd5e5d@gmail.com>
	<fdc7673e-4ea7-9bfc-b047-151d9d86bba1@gmail.com>
	<2394ea86-6a5f-ddce-8929-a37376192eaf@gmail.com>
	<fd838055fc92c0ee0a630ba5ccf181c0dea31051.camel@cybertec.at>

On 11/06/2018 05:05 AM, Laurenz Albe wrote:
> Ron wrote:
>>>> However, one or more of our big (and schema-identical) prod databases (which are each on a different server)
>>>> it is finicky and tends to just "sit" at a random one of the CREATE OR REPLACE FUNCTION statements.
>>>>
>>>> The "list all blocking queries" I run doesn't show that anything is blocking it (though it blocks
>>>> everything else), and neither top(1) nor iotop(1) show any activity.
>>>>
>>>> If it matters, this script is fed to the databases via the JDBC driver, and it works fine when I run it via psql.
>>>> (I'd gladly run the scripts manually, but these are child databases, and a parent db must be updated
>>>> at the same time by a canned application.)
>>>>
>>>> Where in Postgres can I look to see why it's just sitting there?
>>> select * from pg_stat_activity;
>>> might shed some light?
>>   
>> That (plus pg_locks)  is the heart of the "list all blocking queries" statement I copied
>> from https://wiki.postgresql.org/wiki/Lock_Monitoring.
> If there is nothing with "granted" set to FALSE in "pg_locks", you are not blocked by
> a database lock.
>
> What is the "state" of the hanging database session in "pg_stat_activity"?
>
> If it is "idle" or "idle in transaction", then the lock must be in your Java process.

Good question.  I'll look at that the next time we try it.

-- 
Angular momentum makes the world go 'round.




view thread (8+ messages)  latest in thread

Message-ID: <02bf9cee-b94a-5eff-36a4-036f29458003@gmail.com>
Permalink:  ../02bf9cee-b94a-5eff-36a4-036f29458003@gmail.com/
Also on:    postgresql.org/message-id/02bf9cee-b94a-5eff-36a4-036f29458003@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: <02bf9cee-b94a-5eff-36a4-036f29458003@gmail.com>
  References: <924318ab-f639-8116-e3a4-af4890dd5e5d@gmail.com> <fdc7673e-4ea7-9bfc-b047-151d9d86bba1@gmail.com> <2394ea86-6a5f-ddce-8929-a37376192eaf@gmail.com> <fd838055fc92c0ee0a630ba5ccf181c0dea31051.camel@cybertec.at> <02bf9cee-b94a-5eff-36a4-036f29458003@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