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 1iVNaX-0004U5-Fs for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Nov 2019 22:27:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iVNaV-00072Y-Iq for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Nov 2019 22:27:39 +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 1iVNaV-00072R-A1 for pgsql-hackers@lists.postgresql.org; Thu, 14 Nov 2019 22:27:39 +0000 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iVNaS-0000Bg-Gi for pgsql-hackers@lists.postgresql.org; Thu, 14 Nov 2019 22:27:38 +0000 Received: by mail-qt1-x841.google.com with SMTP id t8so8638343qtc.6 for ; Thu, 14 Nov 2019 14:27:35 -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=wvWkQbKA2bwZfcEL0d6baAoDWWydWn4iVGtwJb6zMyM=; b=P8rErAK/AgIKbPIfGqnRE+B8cqBjsSkA0JM8919ICVI+GUZOolbJaEMf/bLztjjtM0 HWBzCuqpaalmGfbL8/2XjW0uvGsbzosR4KzmcTw8kDYTt0RyOkp4Qi7lH/FGeclXaB/9 +qfi/BxJVUMVL9eqxTeQU5DpModxhlpiJ/I9fRSZ3YqRy2QlWFNbiO7O+NaCXk8A+DYE Stq0wEQUo7DgGJxBwmh4Ig8iDPGsBEw+bm4Ed73oU1uhTGusEtc8MtcnTkyp9x5V07hc 4NAC2+ieDRH3MoPAYBFqlcZ7eru/rF8L5/rnbqUIsD6J0008+bwno6ajg19z3gr7bNFx i0Yg== 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=wvWkQbKA2bwZfcEL0d6baAoDWWydWn4iVGtwJb6zMyM=; b=eI/BQF9Q10Th6SgThnbCZhwetJQ/PuLd4bUFnfsuOAdrPBbdXbvHpWv6yFxlgrWGkc ifKaEB/kkztWv9wqPrWheJ9qXEVczZ4Nm8vlTRibAWIGnmITD6tsediPNmnE/zpCDY2s tymr50FwoMQaVFo0nxxoAy/33IZnpotvhgYSFoenKsDUzDoEWToT4XWPBrCbqxgT6503 kirVQpbPtqPA/EHmcLIDCXm/UhI4BK7AsAQJFLBz1AkOOpz05j/xHkYjZ3Hl4mQzi2Px piZPHtpKVoaUq1vg0/leC+F3LZL8TJCDRAizzSvP1w4MzlfzbDf2SGD0v7rSBPcdjRR4 5OAg== X-Gm-Message-State: APjAAAUD4FNBMt2nnaj0YwZ1MaWCCRsbVvUvCy9tjC9O71tLVzDYKWX+ mgqENQiQu/o/vaYNXqGP50aDAw== X-Google-Smtp-Source: APXvYqzWAIr3gAUcLzvkWrSkMMRVN+sIpli9FhdZMAwUBiNqljgPhUM5I0rr+gbElU3IaRBJiIvdSg== X-Received: by 2002:aed:24af:: with SMTP id t44mr10729103qtc.135.1573770454337; Thu, 14 Nov 2019 14:27:34 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([172.98.67.9]) by smtp.gmail.com with ESMTPSA id f39sm3879869qtb.26.2019.11.14.14.27.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2019 14:27:33 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id EA1DC300504; Thu, 14 Nov 2019 19:27:29 -0300 (-03) Date: Thu, 14 Nov 2019 19:27:29 -0300 From: Alvaro Herrera To: Tomas Vondra Cc: Tom Lane , Mark Dilger , pgsql-hackers@lists.postgresql.org Subject: Re: Missing dependency tracking for TableFunc nodes Message-ID: <20191114222729.GA23410@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191114222232.o76u6jdvf53ozjjk@development> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Nov-14, Tomas Vondra wrote: > Isn't that solved by RemoveObjects() doing this? > > /* Get an ObjectAddress for the object. */ > address = get_object_address(stmt->removeType, > object, > &relation, > AccessExclusiveLock, > stmt->missing_ok); > > I've actually done some debugging before sending the patch, and I think > this prevent the issue you describe. Hmm .. shouldn't get_statistics_object_oid get a lock on the table that owns the stats object too? I think it should be setting *relp to it. That way, the lock you're proposing to add would be obtained there. That means it'd be similar to what we do for OBJECT_TRIGGER etc, get_object_address_relobject(). I admit this'd crash and burn if we had stats on multiple relations, because there'd be no way to return the multiple relations that would end up locked. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services