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 1v6sk0-00BGuy-Ie for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Oct 2025 15:39:40 +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 1v6sjx-006Pm5-Ve for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Oct 2025 15:39:38 +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 1v6sjx-006Pk7-LT for pgsql-hackers@lists.postgresql.org; Thu, 09 Oct 2025 15:39:38 +0000 Received: from mail-io1-xd30.google.com ([2607:f8b0:4864:20::d30]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v6sjv-000sgO-1t for pgsql-hackers@postgresql.org; Thu, 09 Oct 2025 15:39:37 +0000 Received: by mail-io1-xd30.google.com with SMTP id ca18e2360f4ac-92aee734585so41976539f.3 for ; Thu, 09 Oct 2025 08:39:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760024376; x=1760629176; 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=l32nMs0fzR+pRBnyz24SPMqg/av6v9y1CXZiA3CV+70=; b=hwRJFIJqsUBSSLLgNSj8BNvwwqfoX5n+iHQCjCSVTHTTJYadpdG44Wg26gC60kOZ0w oRzmsIaysiFnUSzPUmfwtmcLGHxZkCEjRAp1asv3k1tyq60WKDnI+zMOwaZ9lwjR22Qu j+l1tSY/ivS/0nPm1xBW0/bYjfBX2e0qYmMcqGi1vwuzrKn4y5mqJWOt3HdnhutIujpz I+exBdW7FQJ0xpJxENwqIaHcBeM/1LeKpgXXgtzXqgiuVhwQ3R7hHDVKZcardxGtmpy6 R6XW15xG0VBnPe/il0psPlD96gSMB55CmbBh6ds/vNTA2+AJtuEvhzU2TbMkgKmIVQ6N 2i8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760024376; x=1760629176; 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=l32nMs0fzR+pRBnyz24SPMqg/av6v9y1CXZiA3CV+70=; b=bnmlAQ4Qaxr4PhakJcUA/5+SMWVJEe3+P1JcT8DGgW7aiNaQ+ZI3U2RZKp036zWt/E kKs2khKROI5lPjOUMx61FSUN1aLrKTqJ5XJAu8axZvGt1jv6cMDqfxO7U2SXPywx5v6w HtJHrdljIvkRJ4QgsdxEGKV9JB7/Gg8D8oGCHYdLAD6xbvn6xJhKaSlRMB6nQgfUlu+n LUJYsEqYSwU4vU/avzmAlrIBblelqn1Bb7+E03qnO3XjU6Wyh2+0bZlkecIkUIyTuzhU GrK/TtWRdZnbC/xSgyIh+ZoN//HVe5Do5BjPX+VmHYtjI3bWeA0ePwyxaCHFuQR/ZQiY xhKg== X-Forwarded-Encrypted: i=1; AJvYcCVvx0ZzkhE25B+VLbLV0h3U+zlda/5HLpUOL+rl+2W1tNjz8GW9N5r89ywijaqrINcj8wcNXhgdzVNExg3q@postgresql.org X-Gm-Message-State: AOJu0Yztu/uVjKA7ApUTY8dxUioczAo4F5w69xPqhaq4riTKBK4bKn6C a1shpBX65oxOuqdBS+UwzKlP/LOUEng6Qez/836NsHSsSYhdv1J2ZwBH X-Gm-Gg: ASbGncuS7lnskSuOBqfl/KdgoZ8wNKvQ6rWh3a6LyGHDUXMPR18+o3ptPktAM9LKhAs jR+KxKSRvZ/fTq/hYYr3N+XUtDJ+q6Ydr28iWRmodn3jZ90mjAjX1PL5B2opGOPBnqUOjiPC7C4 FIzeQhXL94SnxmUWn4hRk5mmL0TmunGc4wHbN1kQMPi6gWTiWbxP5vePedGT45v5nYM93LMlNi+ kxQHOLWzprOLeqp+uij7X3XX9m3vezspJSDJinanx9Nd/4xHd9MjmwhbhGAK5GoVMFQ9MUqbzxI 06GjXUsdXAPoLUD9/amGtKIMGgjEh1uTVWAp3nXsTcevOzzOFxsTua9Ck0VRvKg8gwYz/ChRAkn Z0bEhjiQ/dy9vuhGEbYwlvAq7Yp9sFb+gfnSNmHPGd3zDqPw+UXzSz9CelvB/YP7cP3qgZI812Z BNgLYPTMzHCyXtYd7lzOrWbSJzouBZqRxRcZVigAQvqsY/6Uc= X-Google-Smtp-Source: AGHT+IHbS3xLnOJwIhoc6fwXYz7XINOnNFNaMHlANHwwPuCmaiSge+Cc8x2Zn/58EM1shCjSqtT1aQ== X-Received: by 2002:a05:6602:29ce:b0:91d:94e0:2165 with SMTP id ca18e2360f4ac-93bd16f170bmr935266139f.0.1760024375711; Thu, 09 Oct 2025 08:39:35 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-93e25a3e92bsm2278139f.14.2025.10.09.08.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Oct 2025 08:39:35 -0700 (PDT) Date: Thu, 9 Oct 2025 10:39:32 -0500 From: Nathan Bossart To: Jeff Davis Cc: Tom Lane , 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> <3432170.1758730414@sss.pgh.pa.us> <8af53c6e8992aa706e63aafe60a3bcf100b524d1.camel@j-davis.com> <7b0e2774cdcc8f522ac82f64a8d7266f353a5094.camel@j-davis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7b0e2774cdcc8f522ac82f64a8d7266f353a5094.camel@j-davis.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Oct 08, 2025 at 08:28:01PM -0700, Jeff Davis wrote: > Actually, now I'm unsure. v4-0001 is taking a lock on the table before > checking privileges, whereas v4-0002 is going to some effort to avoid > that. Is that because the latter is taking a ShareLock? I was confused by this, too. We seem to go to great lengths to avoid taking a lock before checking permissions in RangeVarGetRelidExtended(), but in pg_prewarm() and this stats code, we are taking the lock first. pg_prewarm() can't use RangeVarGetRelid because you give it the OID, but I'm not seeing why stat_utils.c can't use it. We should probably fix this. I wouldn't be surprised if there are other examples. -- nathan