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 1iVOCW-0005t2-1w for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Nov 2019 23:06:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iVOCU-0001sx-Lq for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Nov 2019 23:06:54 +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 1iVOCU-0001sq-6C for pgsql-hackers@lists.postgresql.org; Thu, 14 Nov 2019 23:06:54 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iVOCR-0006fb-2v for pgsql-hackers@lists.postgresql.org; Thu, 14 Nov 2019 23:06:52 +0000 Received: by mail-wr1-x441.google.com with SMTP id n1so8762776wra.10 for ; Thu, 14 Nov 2019 15:06:50 -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:references:mime-version :content-disposition:in-reply-to:user-agent; bh=vfHZ5pfgyvpssgKWU2Jt3rfnv5bxDeJYOj6u1foCJQI=; b=WwYV7SwwNEXhLz6maOPLntpS9uJSIvySuw7lpLKBRi00qwGG4iQ+AK3SXvYW4zN8UT /EQ+dTazpad6uRfTWj0A5MHE8twIxgvfZLht2SXdYF4Fd6w2XOp3kP9LaGhReLJlWQho Boc9QJ1Jyoxok255z7HjxL9IbTosxaySj5dQLd5nc9KviqissfneAsJX5gROQa1NgqAC C+HeR5coFkwNVRSxJFKTywgePc8f7X3m0/+U8Z/7P05JKgaNUpl+eoYnHaA7c2ipb6SA x5j5gkP9KylY0f7KkRck1UQxOlEgHAOFX03S+lRBXFTE/r6lXNAhw5R/rZrUfp1If9+9 fMlA== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=vfHZ5pfgyvpssgKWU2Jt3rfnv5bxDeJYOj6u1foCJQI=; b=MUFQM3lz/53a25ZUMBlVrx0wV6yYiWDZkKAhQYgVcEvijJDy0v/7ePzVp3cHZURYGp k5iPqKoWaF0Ukk+EjDfiY2X1ihAYJGZLfgbGJe0Xr63eIDVkJdpFT/HhLucXLiGni7O0 CI9oF+18LTwR70aOxCav3HVR0vGtUoZlL+AKfm/kfCsadi1ZgDEb+g3m3A+KRdk67xJP L9bGIsjZziRRqAqnovGHB9vHC0KQuHOixWsNZsX+MPZKTlNLNE7c6+F0mwpyilc+sJdr OKJcP0j1nwGChssjO+JgGH2c2onxyphVSFr+v9wFOV4w0f2y8IPBXpg3GoMZ/mPxFWPp SCsA== X-Gm-Message-State: APjAAAV2wvDdnFkgnBNXWdLVO5I1n4Y4n35fE7Z5VHMFeUSfZ8cCK0X8 xXGvKnEYSA6MBu4sDt1zf4awsg== X-Google-Smtp-Source: APXvYqwMfTn3pITJ846Yn3uF12ngIfCKAL++4bKmYx2Ibf8BZ4wdcmaQd7kderugZTl/HiJmU1KJww== X-Received: by 2002:a5d:6746:: with SMTP id l6mr1279750wrw.349.1573772808706; Thu, 14 Nov 2019 15:06:48 -0800 (PST) Received: from localhost (ip-86-49-253-92.net.upcbroadband.cz. [86.49.253.92]) by smtp.gmail.com with ESMTPSA id y6sm9010850wrn.21.2019.11.14.15.06.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2019 15:06:47 -0800 (PST) Date: Fri, 15 Nov 2019 00:06:46 +0100 From: Tomas Vondra To: Alvaro Herrera Cc: Tom Lane , Mark Dilger , pgsql-hackers@lists.postgresql.org Subject: Re: Missing dependency tracking for TableFunc nodes Message-ID: <20191114230646.7tohuvuhquy26mou@development> References: <20191114222232.o76u6jdvf53ozjjk@development> <20191114222729.GA23410@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20191114222729.GA23410@alvherre.pgsql> User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Nov 14, 2019 at 07:27:29PM -0300, Alvaro Herrera wrote: >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(). > Hmmm, maybe. We'd have to fake the list of names, because that function expects the relation name to be included in the list of names, and we don't have that for extended stats. But it might work, I guess. >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. > I think that's less important now. If we ever get that feature, we'll need to make that work somehow. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services