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 1irUE2-0008V9-BQ for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Jan 2020 21:59:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1irUE0-00028b-Vm for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Jan 2020 21:59:48 +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 1irUE0-00028S-Ja for pgsql-hackers@lists.postgresql.org; Tue, 14 Jan 2020 21:59:48 +0000 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1irUDx-0006BT-Pn for pgsql-hackers@lists.postgresql.org; Tue, 14 Jan 2020 21:59:47 +0000 Received: by mail-qk1-x744.google.com with SMTP id a203so13765463qkc.3 for ; Tue, 14 Jan 2020 13:59:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=mBO286HfsXwT3NPpIL5nNejTOQESpZ7Oq/4aF07vsVA=; b=F6xnJUnEuR4WLkwr7ivBD58DBQ79ho7qgmAiLkq06L5OGmuGRRGzLQb2bVmD/pEyj8 kYieLTXV/z88Y/nJMqRE7l9K27vutRz8JMzgWcQupRTtF+X9VyqQZx3tgwHKf7yshYqh GUIb2UGSZsF7BvWV8h0RvQlNudnASDD3eq3Tj9yMS6Uj42lV0nBOR113kOjN2gmS0+Oy ap/OegabQ6hHoDJAP7Nwwy7d1nVE7MpldD56Wi4gAWEhR8zNCOl6LmbdNql4yqqlOxSP 7esJwoNVcY4r+IDvqLApqd5NbgkIBU4NcHt0Uu8kPMVGf8V0wAeghVVLjzpnLxIQaaIa KYhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=mBO286HfsXwT3NPpIL5nNejTOQESpZ7Oq/4aF07vsVA=; b=eWLWNC/wI+52zaHo0RtypANcSrTbzyuY42pli1dWLkLcmgyCbu1zly95p6rDSujGHb m3pCzUygFJQi3dKeX4d1ZewdqjvKTuqZoM87VUxsp2/4QwlNTun2gnJ/9AVpLVHtQRgA GKKVy7VbnprVT4YdpNfnwndAf+vpH6ZrhKXYFbUdKLl1zrbwgW0i2g8aNbh6NnDPrmV/ o+YwBQowl+SASTrlKKoOEQ0Pm+3J/oeAUWepWAwxLc/+XkWFu+CQ+nM5h+fIUO8t7nTQ Bt63c8ipMyRaf2v30eDeOxdMZLLJrXN2acBy4mPpAavUYImWPvm4jiSEXEBeEJ9eUrnK mPyw== X-Gm-Message-State: APjAAAUZRMLpD/Odru+6Y/TCFsI6dh4Kgr+ggV6ljckpomkxPR4haarE BjeRCHs0XlRjbuhYgyNu2O4wik6Lr920aQ== X-Google-Smtp-Source: APXvYqze/+F7Ux9Jv0Lzjd5YRrMxGMFeS0ncnBStaZrOSqmkVS86QC2pR5X+SDRqeoQshmiHGC5yvg== X-Received: by 2002:a37:4792:: with SMTP id u140mr20215731qka.100.1579039184933; Tue, 14 Jan 2020 13:59:44 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([179.56.49.248]) by smtp.gmail.com with ESMTPSA id j15sm7309643qki.47.2020.01.14.13.59.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2020 13:59:44 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 5791B30081F; Tue, 14 Jan 2020 18:59:42 -0300 (-03) Date: Tue, 14 Jan 2020 18:59:42 -0300 From: Alvaro Herrera To: Tom Lane Cc: Mithun Cy , PostgreSQL Hackers , PostgreSQL mailing lists Subject: Re: DROP OWNED CASCADE vs Temp tables Message-ID: <20200114215942.GA18482@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5771.1578961625@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Jan-13, Tom Lane wrote: > That seems fundamentally wrong. By the time we've queued an object for > deletion in dependency.c, we have a lock on it, and we've verified that > the object is still there (cf. systable_recheck_tuple calls). > If shdepDropOwned is doing it differently, I'd say shdepDropOwned is > doing it wrong. Hmm, it seems to be doing it differently. Maybe it should be acquiring locks on all objects in that nested loop and verified them for existence, so that when it calls performMultipleDeletions the objects are already locked, as you say. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services