Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1treqk-006t8O-Be for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Mar 2025 15:15:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1treqi-00DjJs-LF for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Mar 2025 15:15:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1treqi-00DjJj-AX for pgsql-hackers@lists.postgresql.org; Mon, 10 Mar 2025 15:15:24 +0000 Received: from mail-qv1-xf2e.google.com ([2607:f8b0:4864:20::f2e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1treqg-002309-25 for pgsql-hackers@postgresql.org; Mon, 10 Mar 2025 15:15:23 +0000 Received: by mail-qv1-xf2e.google.com with SMTP id 6a1803df08f44-6e8fce04655so32087886d6.3 for ; Mon, 10 Mar 2025 08:15:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741619722; x=1742224522; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=pRBNqyjGItibXxjj36D5tCs7yj/ZfDIbn/JqwOswohs=; b=Qu1CsKK6AqWlcINf4aFdP0OMlzWMIr3usmlc6thivTId3quXmySNV5mJlFSbHVtOhe Z7Eu9pYzc5vblq57o/7FpB2BPb4zI+AiEfDrfy9w1N/swPrzwEfvi4a5iFxyFFeKkSn4 L9JSPWG2Vc5SXPBab8HsK0cXSH5SUwLYUwozqF2DBHaUcH/JKtX5vIGrLUZe54aA5yiF hXpQO9UKrBVxoaQa1jPKi0E8rZqAZQT2rgH1py8OV7t9p0Isg1CUCfB6BQTisQ553HAd q6R+7dpEUIVOcSpn8XFrk1DjRiyGaTdqGXbtjWJnHa3QADewdZmsfZ2TI0SiB18yuUjb 5Bnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741619722; x=1742224522; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=pRBNqyjGItibXxjj36D5tCs7yj/ZfDIbn/JqwOswohs=; b=gU15Dq5CUcSxWzJd3d8ViKQZpCb9XfhPXAKTcz9dAuNO3g+bPBGWS6Whx3jxZlc78i 8gc8vDx6DjMh/ncxu8+XJ/Il85ifsntA15yxjUKAKY7/cnNPHVt7FVP6vjeG4/9par0v PTAU2uRYoCIKaGselgWj7wztHPuokcrj0wovIQUalwVZ7I2HIJtjL8H+C4901cxXx276 V9xtwWRk50mO98xuFu+yv/Q7vxfAvYK1gXD9K1p/yaddiunW44aD+0vdedfuO0ahtihd DNu289uJ6X8OdQ7RzutmYv6WzLfaiWKX7em8Vy5WoV0NgxNK7qaS3o5Iorq8XYFQEfDw gzXQ== X-Forwarded-Encrypted: i=1; AJvYcCVMAeIuuqdodZzY03VqWgqeAEagXiMW/AX9+hPFJIzwKRSCrWnJ70zVxJnmcolNmwYhZJIEWYAQll9ox92n@postgresql.org X-Gm-Message-State: AOJu0Yy6XO8Ssu4h6HAjDUMdXZSCo1QAmQ/0QUnw1LLZrc9ildPdpk2V 0S239IQNiZYdKnQxJznIaz/X7LfJc5AqMqt7jtqTQ8++G9LH0g5I X-Gm-Gg: ASbGncshd6l25O33PBcM6T+N9dZrZOekM6x9Z6PzhwOtq8gIIsZNJcy2Kas+Ddve7bh LlOcWXA4ErvAa5j6OoC/kweOOMUNeabEfjBXn9VqF1neRi5iPAblFJdG+YKzKBsSQzbDUq1u66e Es0NmukiJzHnNTBwrPAM62/zCbrsd785GIbwbjmGcy7zNrxgpYVW264AP//DlhejJKZRPHFSqWf 9UH1nUV/IXuuECi//u0HE8jGUq9Lkwi1Xp2PinFUbTvGNyNodzn8QlnU8q76joziTAIP67uvDYn e+pGDN1qPpqrhA8tP6q4jAVgvsU1OuqAN+/g+L0qEZvcfp1r+RGdmn9LQKdlyKPpuruAwb3nVKn zwt3bf6IgQ6pD1mU7YQhrULsmhX3Qaxoavuk= X-Google-Smtp-Source: AGHT+IFt7o19oeFtM667hROavEVp9ch4Gs9l34mvzil4in49WU1BSWbqkwxkZbNcT3Wqd7M68Z92oA== X-Received: by 2002:a05:6214:1d02:b0:6e8:ebc6:fd5f with SMTP id 6a1803df08f44-6e9006326e9mr194884446d6.20.1741619721756; Mon, 10 Mar 2025 08:15:21 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6e8f715b4fcsm59293286d6.78.2025.03.10.08.15.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Mar 2025 08:15:21 -0700 (PDT) Date: Mon, 10 Mar 2025 10:15:19 -0500 From: Nathan Bossart To: Tom Lane Cc: Ayush Vatsa , Robert Haas , "David G. Johnston" , PostgreSQL Hackers Subject: Re: Clarification on Role Access Rights to Table Indexes Message-ID: References: <149429.1741472260@sss.pgh.pa.us> <279947.1741535285@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <279947.1741535285@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Mar 09, 2025 at 11:48:05AM -0400, Tom Lane wrote: > Nathan Bossart writes: >> On Sat, Mar 08, 2025 at 05:17:40PM -0500, Tom Lane wrote: >>> ReindexIndex() faces this same problem and solves it with some >>> very complex code that manages to get the table's lock first. > >> I noticed that amcheck's bt_index_check_internal() handles this problem, >> ... >> stats_lock_check_privileges() does something similar, but it's not as >> cautious about the "heapid != IndexGetRelation(indrelid, false)" race >> condition. > > Egad, we've already got three inconsistent implementations of this > functionality? I think the first step must be to unify them into > a common implementation, if at all possible. Agreed. I worry that trying to unify each bespoke implementation into a single function might result in an unwieldy mess, but I'll give it a shot... -- nathan