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 1gSlwr-0004Sx-3l for pgsql-general@arkaria.postgresql.org; Fri, 30 Nov 2018 16:47:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gSlwp-0005Mw-Fh for pgsql-general@arkaria.postgresql.org; Fri, 30 Nov 2018 16:47:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gSlwp-0005IA-0b for pgsql-general@lists.postgresql.org; Fri, 30 Nov 2018 16:47:23 +0000 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gSlwm-0005Fq-K6 for pgsql-general@lists.postgresql.org; Fri, 30 Nov 2018 16:47:21 +0000 Received: by mail-oi1-x230.google.com with SMTP id h25so5275420oig.1 for ; Fri, 30 Nov 2018 08:47:20 -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-transfer-encoding:content-language; bh=CeAa9jzKeBaVGg/lJIp2oVR4OWCQxrN5zS8vHdah4kY=; b=hKqYqeab6DYkXiQnJlhz0v/SpwycIJDDWhl3yET2PEdPKXSuRygBsZkFeCnAH+Di5X e8JVb7WVTA4yNlrrauyZM+oB9l5+M4VXVoFrkenqOPhaI77LeSvavqbAIYfobpA196kP soVWXIxP32KUeIwOSoB4vcuDWwXVchRbAJLx/FE5Eu+dRbGEsqXrOiUMZMUVrv72rDwF r6LYa/NkeC0vBTD6bIJO6c7X40Fxm/WvhPnN6LkAJxl4AKdb7/RIhOBZy9I7pYe5zVBl G+K7qf2+pLDhJ4Fr6iTWV/zSJclY7tD0DuONfBkx7OZmoqfyiIYoNkijvivtVflLSVzF c/Yw== 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-transfer-encoding :content-language; bh=CeAa9jzKeBaVGg/lJIp2oVR4OWCQxrN5zS8vHdah4kY=; b=V0kNRGFxR5iEHCgJ+U0Cmpw9IA92lH2Zp4uTCqf7gKo4J8t72W4bjJ6jV7zkrDjdyT zjEZIg17vS40+GWdZlLHk8cVaClWiNSWIM1fOdZpJn/uUE2oOWS00nZJEKCMVZQZT0an XNcIT80utnr8jbtpcNlwcBk/PyG6/nKukJ1/bDQu53NWtIir1f5UYJDatIpe+9SVPuBQ NC6SmUBBsN7/ebL3aNU7lcAUCKK+sq9dfx7MY9yJUh6v0KV9EojcEqDWvYmv72Pa5mfV OHMjg/1IEXgWB4AUMOREHOBPRdp+loafScTs7aqO7Od4Ayor4nIWj54pSjO5ZUikm4Vk hNUA== X-Gm-Message-State: AA+aEWYBuqSPW3BTYticwQd8euuSQeaeETDWL/Cs0NVs2vpe1LYH771l Qc1vSnwUpKtMVpjp+nCb4XiyELb9 X-Google-Smtp-Source: AFSGD/Vgar/uaVbqSIhr4zW/oyeek3Ce7weS5T3n6ajySYW15qVRe4qUdlRbK+wxF3O7igOtDUwKJw== X-Received: by 2002:a54:468b:: with SMTP id k11mr3565471oic.27.1543596439587; Fri, 30 Nov 2018 08:47:19 -0800 (PST) Received: from [192.168.1.10] (ip70-171-116-89.no.no.cox.net. [70.171.116.89]) by smtp.googlemail.com with ESMTPSA id 18sm2269080otf.59.2018.11.30.08.47.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Nov 2018 08:47:18 -0800 (PST) Subject: Re: psql is hanging To: pgsql-general@lists.postgresql.org References: <58390119-ac5f-1f93-4c6c-9ac01902c863@gmail.com> <28459.1543595917@sss.pgh.pa.us> From: Ron Message-ID: <799eadd6-4586-4fd4-449a-15ed26a24bd8@gmail.com> Date: Fri, 30 Nov 2018 10:47:18 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <28459.1543595917@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 11/30/2018 10:38 AM, Tom Lane wrote: > Ron writes: >> We have a seemingly identical problem in v9.6 on our big prod databases.  It >> worked perfectly in 8.4 *and works perfectly in 9.6 our small staging servers*. >> A giant sql script that drops the oldest child tables from a large set of >> partitioned tables (by dropping all relevant triggers, indexes, functions >> etc, dropping the oldest children, adding the new children then recreating >> 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. We thought of that, but... 1. Even when that process is the only one touching the database, it hangs. 2. It worked perfectly on 8.4. 3. It works perfectly on 9.6 using the small staging database. 4. It works perfectly when running the script from psql. Before that weekly job runs again, the application team is going to upgrade to JDBC driver v42.2.5 (don't know what they're using now), and add protocolVersion=2 to the connection string.  I'll post an update next Wednesday. -- Angular momentum makes the world go 'round.