Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gSloT-0003rs-KH for pgsql-general@arkaria.postgresql.org; Fri, 30 Nov 2018 16:38:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gSloS-0005Gd-D4 for pgsql-general@arkaria.postgresql.org; Fri, 30 Nov 2018 16:38:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gSloS-0005GW-57 for pgsql-general@lists.postgresql.org; Fri, 30 Nov 2018 16:38:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gSloP-0002i4-JC for pgsql-general@lists.postgresql.org; Fri, 30 Nov 2018 16:38:43 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id wAUGcbHi028460; Fri, 30 Nov 2018 11:38:37 -0500 From: Tom Lane To: Ron cc: pgsql-general@lists.postgresql.org Subject: Re: psql is hanging In-reply-to: <58390119-ac5f-1f93-4c6c-9ac01902c863@gmail.com> References: <58390119-ac5f-1f93-4c6c-9ac01902c863@gmail.com> Comments: In-reply-to Ron message dated "Fri, 30 Nov 2018 10:25:02 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <28458.1543595917.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 30 Nov 2018 11:38:37 -0500 Message-ID: <28459.1543595917@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Ron writes: > We have a seemingly identical problem in v9.6 on our big prod databases.= =C2=A0 It = > worked perfectly in 8.4 *and works perfectly in 9.6 our small staging se= rvers*. > A giant sql script that drops the oldest child tables from a large set o= f = > partitioned tables (by dropping all relevant triggers, indexes, function= s = > etc, dropping the oldest children, adding the new children then recreati= ng = > all the relevant triggers, indexes, functions etc). A script like that is going to be taking exclusive locks on a whole lot of tables. My guess is that you are running up against lock conflicts against other activity in the DB, and that the "hang" is just waiting for other transactions to release their table locks. Looking into the pg_locks view could be informative. regards, tom lane