Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gJr86-00047F-DS for pgsql-general@arkaria.postgresql.org; Tue, 06 Nov 2018 02:30:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gJr84-00049F-Po for pgsql-general@arkaria.postgresql.org; Tue, 06 Nov 2018 02:30:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gJr84-000491-Ay for pgsql-general@lists.postgresql.org; Tue, 06 Nov 2018 02:30:08 +0000 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gJr80-0003oa-8u for pgsql-general@lists.postgresql.org; Tue, 06 Nov 2018 02:30:07 +0000 Received: by mail-pf1-x436.google.com with SMTP id n11-v6so5366577pfb.6 for ; Mon, 05 Nov 2018 18:30:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=WxDk2YOJpAWzp3RlIFbMyeUNC+zlxHCnZdtim7oFg6I=; b=h4YAFdTMFNFHLTBxYO4wd7zqtuAfs1zrGZt0BkQcMmoOJN03aZt+uNg/KjjKtw8BGL HgBbw1A5pQa7mx/CfBsTEN6nhIX0jDErKQalZHUkGz22JkbanayXxtXNdyMpXG7LH2w4 BGjVNj1zIqaA6f/NBq1YdE4IoIhWBTamteEHbTmI7U1p/2RR3AMC5qU44LRURClHbe2A lMpv+g/lbOMOda7IG0ZL/tDS5zSAKgd4s71jPsdCP41zXZpn5UDCUugnlWVVTGtHpMEg 9J3Hr1DBvjFZ49Rd+t8literIUi6ubl/h3F2KA0CUptsVT37sWS4A2VYoLHYRzhgUfsA jX1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=WxDk2YOJpAWzp3RlIFbMyeUNC+zlxHCnZdtim7oFg6I=; b=Pu4Bh36Bt+/AqjKXbOZm8uiH1H9yioDjtftNXa81wOwBszVlYXrTMPluGYsztZOlK7 AF440jyv3A/6QHyr5KCqqt5aSsb+6qZkEbbcnOB/kxdJUe06anJ/9DA3zRbaNyirujh8 oP0YL/4bnuiq53Qhr2SQIYPvByGhe9qDFBzJ7E4xFGBWeuNg0Ck7v8Rl3juKOspwsmkC 3ojcuXp6P4dBt1yVUpfq+PkFFJI6vJKdYt7eyiNCFGQAqPiKK5qCkdOfTSe7LtbP3TXt BNxVu+MeyY0mhq3sua069IJmMIxMkX5Pv+FSYm3STbhz1hufK2mDArNw5IT66XQUk0kJ vv5Q== X-Gm-Message-State: AGRZ1gKprztONUctqyHa1gOTEL5YD9jLcN1hJXkXL1+2mRAgJYsu40br A4nosdEGFzEOQFSqGhbw3PEH33G1 X-Google-Smtp-Source: AJdET5e5TiNf3/ImrLChHJE4RrEK1bYgJgsmJgmJSzTLNVTUElIKAzCDy+AO6RXubDyr7bx9KQgpdw== X-Received: by 2002:a63:2a4a:: with SMTP id q71mr8063169pgq.374.1541471402498; Mon, 05 Nov 2018 18:30:02 -0800 (PST) Received: from [10.104.134.14] ([155.100.47.6]) by smtp.gmail.com with ESMTPSA id 72-v6sm57634178pfl.126.2018.11.05.18.30.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 18:30:01 -0800 (PST) Subject: Re: CREATE OR REPLACE FUNCTION statement just sitting there To: pgsql-general@lists.postgresql.org References: <924318ab-f639-8116-e3a4-af4890dd5e5d@gmail.com> From: Rob Sargent Message-ID: Date: Mon, 5 Nov 2018 19:30:00 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <924318ab-f639-8116-e3a4-af4890dd5e5d@gmail.com> Content-Type: multipart/alternative; boundary="------------F1CDE2F5E03B1195F2AFAAFA" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------F1CDE2F5E03B1195F2AFAAFA Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 11/5/18 7:05 PM, Ron wrote: > I've got a very puzzling problem on 9.6.6 systems we just migrated > from 8.4.  (The same problem happened on 9.6.9, but rolled it back so > as to make prod have the same version as our Staging systems.) > > We've got a giant script full of DROP TRIGGER IF EXISTS and CREATE > TABLE and DROP TABLE and CREATE OR REPLACE FUNCTION statements. > > It's purpose is to drop old parts of partitioned tables and add new > tables. > > It *ALWAYS worked* just fine on our big, ancient, production 8.4 > databases (otherwise I'd have heard the screams of user rage), and on > our 9.6.6 staging environment.  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? > > Thanks > > -- > Angular momentum makes the world go 'round. select * from pg_stat_activity; might shed some light? --------------F1CDE2F5E03B1195F2AFAAFA Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit


On 11/5/18 7:05 PM, Ron wrote:
I've got a very puzzling problem on 9.6.6 systems we just migrated from 8.4.  (The same problem happened on 9.6.9, but rolled it back so as to make prod have the same version as our Staging systems.)

We've got a giant script full of DROP TRIGGER IF EXISTS and CREATE TABLE and DROP TABLE and CREATE OR REPLACE FUNCTION statements.

It's purpose is to drop old parts of partitioned tables and add new tables.

It ALWAYS worked just fine on our big, ancient, production 8.4 databases (otherwise I'd have heard the screams of user rage), and on our 9.6.6 staging environment.  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?

Thanks

--
Angular momentum makes the world go 'round.


select * from pg_stat_activity;

might shed some light?


--------------F1CDE2F5E03B1195F2AFAAFA--