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 1wX0oN-0030JF-2w for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jun 2026 18:04:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wX0oM-007u3T-1S for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jun 2026 18:04:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wX0oM-007u3L-0W for pgsql-hackers@lists.postgresql.org; Tue, 09 Jun 2026 18:04:26 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wX0oJ-00000002Bq5-3ewX for pgsql-hackers@lists.postgresql.org; Tue, 09 Jun 2026 18:04:25 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-490bc6a7958so52472795e9.1 for ; Tue, 09 Jun 2026 11:04:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781028263; x=1781633063; 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=SlhHfub0G6fB224RoZV0dWlF5VfYgBQmTQCHAihpUjU=; b=s4Jd5FLeOfpZA1Ue86r1n301cQrcjX9B4XhJA3QYAwFLpoGsKS5o5yHNjn1ACf3Z4K MfjDsmaEtHWaamuikq+e/UGDbcl3loPOA9PmLxm5GswH0cIXZgyBTAeyt3L+tPU0CDv1 hS/vTNAzllylIw4Sf9CoumPGAi+Hvv+LSwbeeoDHgSAUvP13oBdFDooJmOOuv8CH5Ycx leZ5OG9Y2LyZASuvRWdghiWAEWeesIypk+FsXigiid0VDHtO3fDAuR0+vI/f0ZVWOEiH 9M5ds1v1jmKiaf3tjeQ4gw9HTeOIZnaeyLe1ZsoQv/GBp/UAWqduBBcVjpNn6Ov5RqsX WFlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781028263; x=1781633063; 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=SlhHfub0G6fB224RoZV0dWlF5VfYgBQmTQCHAihpUjU=; b=f2XyXnQRHM/WZGoxV0nAUPj5tU+5d/tj2eOla9JYHMu/TJPxzVr58Q9GVxJTvgtXbG W2ay3TroGCdTxb1P+4U7W180jVGZLL8jN6MFbUDeWzJKPWlwUl/+vrYpAzsax7kaP6vT tsoZhsRx7L1yjsVWP5erPxX79DzobtADH8fDGLyXFkp1G5QMlYR76QYiXzDEgWQ1ilQ4 n82Ebo54/dVUVxoN4jyuzS8Nmdq2f920H9O5uMmW5Wgviz7LAq/LUEf4IlVOvqFjr2YX PsTajYE2b+pgTNSB8fmZI2FwFHa3sQyfBVUVGUW/eREDMTHTu4E4/JM3dTVEW4Hqv8DA EsuA== X-Forwarded-Encrypted: i=1; AFNElJ8H0Rnd6EZtWMS4dD8tKG38KCyHDNgDsoKmYEUTgJn1W0+akl7gox+YawNCWmQmRrqO79mlMH5tb7iNbFrJ@lists.postgresql.org X-Gm-Message-State: AOJu0YynQqzMJ/Qb4+EkCev+TxjADL9X+pTtTzC0fGrMrD6yLkBwp7Ao a+mvioJgzsNg/XT91VRy+9L6rAt4TizRHWSed8Iju53DWwraKJxJ+KRc X-Gm-Gg: Acq92OE/h/HVROspRc75brjE2+nrnZs+bf3xRWTYXCQr6GJ4JQhAaN7HBXC3pH105H8 QZDm4PvYwFU8v1WQhlQc/2j6uEBckgXFcLNKF6t50Aas4Dd5URdcStP/tDtDAqvyTu1P9s4CYVo r4HksS/yHOygL1dWDoEh6amVnZiH8CCOKjJcxHhYpWcTFfrQpc/0mAB2xcbPz7U7mhSpytPXtRG F7q+ZvRgZGXFa48nkRVTSG+S1rLSO54m/xIYUM4GBrqCSZhPQGRR9L1AJq0e2Qf1yEfbx4Fo4TL 7xWTlTkuvFsCxxtxKOiPpD3KybAimzSlUsOQ7szPxtoFuL/33jMzdJg4+FfdilhnMUnmoRO2WZ/ 90/KDddJe5KjmCvp0+b97DMco6IWAUWLdAIsW4b0CXZa4PqFir5pSUkir0nrWWqU8IZZ8WBKddn L2lsC892CGf+cu+dZ3/DR/CagcKUuCw+NOdb2GfBxshG9MgEdm7g2sPVVIq20H8n9UULXcFT1Dz B+XeBvwRrmQzJEY97Rvuec3kruEvMrX X-Received: by 2002:a05:600c:8010:b0:490:b4a8:e031 with SMTP id 5b1f17b1804b1-490c2cba8e7mr277705515e9.4.1781028262565; Tue, 09 Jun 2026 11:04:22 -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 5b1f17b1804b1-490bc3fd502sm499384905e9.11.2026.06.09.11.04.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2026 11:04:22 -0700 (PDT) Date: Tue, 9 Jun 2026 18:04:20 +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: <3963e573-4852-4d25-b741-7c5c7e1f9140@iki.fi> <02e28438bd448ff4ee8f6fd78e6b74e657172d73.camel@j-davis.com> <71eb9a8835a28165939da567a9d649fe6d21bfa7.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 Tue, Jun 09, 2026 at 06:47:06AM +0000, Bertrand Drouvot wrote: > Hi, > > On Mon, Jun 08, 2026 at 02:55:19PM -0700, Jeff Davis wrote: > > On Fri, 2026-06-05 at 13:09 +0000, Bertrand Drouvot wrote: > > > the current patch > > > > /* > > * Look up a tracked aclcheck entry for the given object. > > * Returns true if found, filling in roleId, mode, and inval_count. > > * Searches from the end to find the most recent check (the one with > > the > > * freshest inval_count). > > > > What if two tracked ACL checks had different modes? Don't you need to > > do both checks or somehow combine the modes in the tracking entry? > > > > (I'm not sure if this is a practical problem or not.) > > Humm, good point. I was focusing on a "full" role revoke but maybe what you > describe could be a practical problem (in case of privilege revoke from the > role). > > In order to be on the safe side of things, the attached now iterates through all > matching entries (and not only the last one). It's still a flat array as its > linear scan is O(n) in the number of tracked entries, but that's fine since a > typical DDL statement tracks only a few objects. I just realized that the cfbot is complaining, let me fix it and come back with an updated patch. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com