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.96) (envelope-from ) id 1waZOu-001tl5-0u for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Jun 2026 13:36:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1waZOs-00GOH2-33 for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Jun 2026 13:36:50 +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.96) (envelope-from ) id 1waZOs-00GOGu-2A for pgsql-hackers@lists.postgresql.org; Fri, 19 Jun 2026 13:36:50 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1waZOr-0000000197D-1Uea for pgsql-hackers@lists.postgresql.org; Fri, 19 Jun 2026 13:36:49 +0000 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-4626fdc829aso1631873f8f.3 for ; Fri, 19 Jun 2026 06:36:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781876207; x=1782481007; darn=lists.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=WTwW2RuwajbIb129rFHhCdeX54Mf+fL0PrRMITe1Uow=; b=EOFMdGBJQ59f/SVCOMn4cUxmqWrDt4/rArTkUCJrt58lBIZB68/wS7sNXg0Z65CGvw nTkw8zYTdxvA+Inskctgy9CM514YhCgvIiuRW8iJJwXbcnh1iKsxeu7Fc2x4ZKeA9+4s QnBsSO1qgCfivth5F/dRuajeegkb6dTMNtCru4gw8NK64XsVxd3dhnnUKV53Wlof8FM3 p4u/Mw/2nJGd1ntQnHGWzwS2GdgD2hW78seKJuznStAzvWGmF6l4FBA4n513y5q4hREy nQT3lGk6W7brahMtcckKXPmQAHuzOP+BEcEsu8D32ElpsCn5LyFELlWTX0pFg1+rGYr8 cmIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781876207; x=1782481007; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WTwW2RuwajbIb129rFHhCdeX54Mf+fL0PrRMITe1Uow=; b=qvyv+Zrx9ap65b3MaqWbjwcy3D2VWsQFM9VJx+pj0tLUSuNcaSA8GjjZqNNpWp5e9g Tmvt3z2LMo8b6Y43OZnNXEnD8FNsCRNVlT2gercv56MrvUmJ0vsSoLzOeP9qA75QsRQC r9eiH0hj97jyCjcO0SpXsVIFUL6NrtqYWkrzvRMxSaCUlpztiqvkcD4EO7QqR0GkqNlW +Np/pfL/jzw2+ph4OESCzTntQCWknwtV/JdY57ajXRPMPKe7ryCqs2FHEn5N3TQQ05K7 xtGhP1K5EXOt9uQDlOSKVQx2S54pBy6Mi5KO7qvYJeIrT3exTA0ovEj2/ilgEhj2QiLF cx6w== X-Forwarded-Encrypted: i=1; AFNElJ8TN0BGWMKOytPSxqcJ/7dEqFk7PAjj+rsJoz5CAJ54qfDZrdeU9Jzk3HdT/nq7fs8b5PwoKDNBuFcYK+hG@lists.postgresql.org X-Gm-Message-State: AOJu0YwHOE1AIEWmsgCpgZJv+kcQWK4xm7IthMzM+QNATLXv5l8xFiw9 f7B7qjy8jt6pzSd1bF6dyK8cpf/FgCy/4MSVTf+yC2U5+HzW5V50d1km X-Gm-Gg: AfdE7cnYAbPc5aNfnQ5vj0Iw2AxJFFQbPRHxpLOJK5CEPRzmA0MmijoIyO5agoWBOAk E2U4bsPFmcsJabjHJxlKZBLzvfX7KQqcd8n204JQP2CTTOVo/JdyQGzzQQJJeRyDc++WaFiiJfq 4x/Hx9UYvp3V+8u0dfsWoUiXFpFUgYZQByV8CsWIbxsTQteuduwl1R4KihVACVfigMSLjN0xOBq 1D+ZRvOrxFCGgfT478EItE7QMByYld/iCLjLYPDMYCMAAAtzlYjPAZIg4/UkvhvDetqVIA7qDMm kTflGhe3I9XbvtarZhM2KLaMi615XudDrwiBHhyV6DGLL9A2zchugR2vRbMePtUViWRTCXcnPdt aVp1A9spPlZLGuA607BpD9gxra7YKbqiiXPoidiu123iJTqa4kQnXfncVIPGVsOjRs9epvAhtBh 1qNbgMOuOEzQ0d4wNEsNasqilCwG/evTy71hovqXhrgIevT+mklv9i7xABRmpOkPS3Ynj2mMFp7 3ZeO4YQOe8= X-Received: by 2002:a05:6000:46ce:b0:465:e49d:7c6c with SMTP id ffacd0b85a97d-465e49d7cb3mr1586900f8f.30.1781876207279; Fri, 19 Jun 2026 06:36:47 -0700 (PDT) Received: from bdtpg (ec2-15-237-197-144.eu-west-3.compute.amazonaws.com. [15.237.197.144]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4650b67a3e8sm7819076f8f.19.2026.06.19.06.36.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2026 06:36:46 -0700 (PDT) Date: Fri, 19 Jun 2026 13:36:45 +0000 From: Bertrand Drouvot To: Jeff Davis Cc: Heikki Linnakangas , Robert Haas , Roman Eskin , Michael Paquier , Alexander Lakhin , pgsql-hackers@lists.postgresql.org, Tom Lane Subject: Re: Avoid orphaned objects dependencies, take 3 Message-ID: References: <0fc145b9b5cf3f59207cf4ca60270448a2891c46.camel@j-davis.com> <5591d661ea8189f5c057f6b48095f742e0d772f9.camel@j-davis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Thu, Jun 18, 2026 at 07:13:38PM -0700, Jeff Davis wrote: > On Thu, 2026-06-18 at 16:21 -0700, Jeff Davis wrote: > > IIUC, we cannot have false positives (tracking ACL checks that > > wouldn't > > have caused an abort) nor can we have false negatives (missing an ACL > > check that could cause an abort). > > Idea: what if we check for changes in ACLs on the object, rather than > whether it passes the check or not? > > Then, if track an ACL check that wouldn't actually cause a failure, > then it still might be acceptable to throw an error if the ACL changes. > Still some details to sort out, so this is just an idea. Yeah, I think I do prefer this idea. As you say, that could cause an error even if the ACL change does not REVOKE anything on this object (say the ACL change is a GRANT), but that should be rare in practice and probably much simpler to reason about that way. But I don't think tracking ACL changes would be enough though. I think we would also need to track ROLE changes. So what about? - Save a copy of the object's ACL and compare at recheck time: If not the same, then error out. - Save the ROLE membership and compare at recheck time. If not the same, then error out. That way we cover both parts: the object's ACL and the ROLE membership. That's just a high level idea, I can move forward and try to implement it. Thoughts? Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com