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 1gFJbP-00069e-57 for pgsql-general@arkaria.postgresql.org; Wed, 24 Oct 2018 13:53:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gFJbN-0001wn-As for pgsql-general@arkaria.postgresql.org; Wed, 24 Oct 2018 13:53:37 +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 1gFJbM-0001wf-Sb for pgsql-general@lists.postgresql.org; Wed, 24 Oct 2018 13:53:37 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gFJbI-0006p3-UE for pgsql-general@lists.postgresql.org; Wed, 24 Oct 2018 13:53:35 +0000 Received: by mail-wr1-x444.google.com with SMTP id u1-v6so5719219wrn.0 for ; Wed, 24 Oct 2018 06:53:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=greycortex-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=Tmg+AmkblRMzbIK+8OLfTAK9coXxttFQv24ciXIZqRo=; b=OmQjxGRIvhD2cDoV+pBCjx3wQxXgT0g4VHfiRjM4isevYI97ynaMH9iCfriWNN/N7P zDuW0CIE3LYLPMsL1yT9v3c2jdPPi13xhigQmbEY4Dc4bDH0tzAnO9YnixH35bqr9VEF C7dT38leytjJYHL8rl0fqJXpcskQLnTvQMUngW5uPM1rBOJ+OXWYq9ZVM8Qg8Vt5fGZe TKXLz9w6u99mOTdPGFzoC2LuLAX1tr1u7r1y4A/Jy0x7BXvR6avNWcaOBcmSfN725Wod sdQcHGCYSanqU11hmfN1aDoosYr4NlciuU+xC0pJZS+icUXvp1Rha9Oedeh5Sgny7vjm GK9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=Tmg+AmkblRMzbIK+8OLfTAK9coXxttFQv24ciXIZqRo=; b=C7htSyu/0uP9Cs0Ik+6z2p2ytOJ8QBV10wphnAyYxxIT2EyxYIXQew/slQh2rDrl83 RxiXjO8tteb2yy2yK3+hEtzwQuRNfv+fs5D8PDFlRfIDV7bYbwDCquZX5W4/lR/cxqM+ 14axRi0wZxVlznMCWc1d43HqeWwUkMbK1u5bgEh/WszgPgc6Wd30xyE+8C6mSZHGoeH0 XmVI8e/1Uy/4cDtjMzl7HzOSNBV5c4/PrFzfXF0t/IIInk3zFSLOq2wveVc72dZD1eb3 DXgKYTuHuhKQZMxj2wSWjDxPm/2ikNvlaj4GmNs4pWQFd4/umBXYnBKA3a/90m4LzIwQ XxdQ== X-Gm-Message-State: AGRZ1gLb7IMIEnicXhgFCzwCQg8Uvpfnk9PxleK2xey41ggDWJWuDU2O 8E4G+t/5309HC7ttEVzhKUPiQiUvkkk= X-Google-Smtp-Source: AJdET5e+ET2yP8YlptyZ3U+1kY26lNv2iAatUFMb87KBWQkzOlGeqj5wUtQbnblbfbYEVzPa+1Vn/Q== X-Received: by 2002:adf:f852:: with SMTP id d18-v6mr2948222wrq.125.1540389210905; Wed, 24 Oct 2018 06:53:30 -0700 (PDT) Received: from ?IPv6:2001:470:6f:c4f:2244:ca8d:5fc4:9a48? ([2001:470:6f:c4f:2244:ca8d:5fc4:9a48]) by smtp.gmail.com with ESMTPSA id r13-v6sm2877588wmg.45.2018.10.24.06.53.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Oct 2018 06:53:30 -0700 (PDT) From: Michal Merta Subject: Deadlock while doing VACUUM and DROP To: pgsql-general@lists.postgresql.org Message-ID: <21fe894d-4fb8-974d-cdd6-2b252852ce76@greycortex.com> Date: Wed, 24 Oct 2018 15:53:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 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 Hello everyone, I encountered deadlock during DROP TABLE statement: 2018-10-23 14:49:55 CEST psql > ERROR:  deadlock detected 2018-10-23 14:49:55 CEST psql > DETAIL:  Process 89171 waits for AccessExclusiveLock on relation 17582 of database 16390; blocked by process 50837.         Process 50837 waits for AccessShareLock on relation 20767 of database 16390; blocked by process 89171.         Process 89171: DROP TABLE IF EXISTS sm.tasks;         Process 50837: autovacuum: ANALYZE sm.tasks This happenend CentOS 7 with Linux kernel 3.10.0-693 using PostgreSQL 9.6.6. There was discussion about similar issue without any conclusions 10 years ago, I'm not sure whether it's a bug or some documented behaviour. https://www.postgresql.org/message-id/flat/482CCD42.1060705%40students.mimuw.edu.pl Is there anything I can do make sure that DDL statement won't be canceled due to collision with autovaccum? Regards, Michal Merta