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 1wWqF1-002tK4-2N for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jun 2026 06:47:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wWqF0-005QOB-1G for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jun 2026 06:47:14 +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 1wWqEz-005QO3-2j for pgsql-hackers@lists.postgresql.org; Tue, 09 Jun 2026 06:47:14 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wWqEw-00000001o6w-3Mk4 for pgsql-hackers@lists.postgresql.org; Tue, 09 Jun 2026 06:47:12 +0000 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-45ef1198766so2914765f8f.0 for ; Mon, 08 Jun 2026 23:47:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780987629; x=1781592429; 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=PgFEX9KcC0VunSZUA1f+UepqdEaKQ3qT2lnvk+g0GUs=; b=WwcN+tuFite5KfEIOWjmLg55loaVNVlt8Nf0C6MttJBOlOOsJegFXUexUzXQtZwdER NDg71wxoOWWlDniyqW07Yjbc3xRYe+5SUPeE7dku9c9c4hL0HGLLMAyoBrifqNQm9X/r iVccu91KX/F7qNKqHWBLZmIiPRfP5lb1x0DKm4fmbrY0EgUCzOqyv1ma0dHLkjV1/Mcj 7w/b9Fd5s3+nuSRIlBqqE2bqsib4Ugh5OXKKd8QggekRSMnXOZKovM+SVyMmDbVKz8Mr R+IHiIwmpdtR/b7USz82pR1Nx93AyF4RiSqYOM//xhmon7g8W7FfjKmPO09PwGqC5dgV YisA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780987629; x=1781592429; 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=PgFEX9KcC0VunSZUA1f+UepqdEaKQ3qT2lnvk+g0GUs=; b=ZXKZWI35vDpoV6Pdb7lp8cjIPVKQ+C7sgv0+2bBHyqTrusFtJie9N+i2TbZg+P+ZFX AtSmgcEcfj7NTwKOHo6PPs+TqaZYculD91ngtjGI+WzQcIuG3JJWCxOR6L69WYf1rCm2 OeHV4y712DfvuUh4/Frk8geXOnpvsyvWHa5nxZxwnca8nXMwr64+qbD6m3TMMSiGyAaI QKWcn/QchSEQ9xW8DKn199rm1tgsX8Pa4kPOTkbA9s/arOoNodTHutT2SV91DICgT5lV G8h/Nw9j5hcr5b4M64FOu29qa9qHUNO9wFi3Derc10Oj4EO9ceaQPLZp/6Mfv/rQA4t0 bj2A== X-Forwarded-Encrypted: i=1; AFNElJ8SxZteBOtrSKpcsnw5Fc5xkwCRfnRdqM2FSKCgFrVTVqlhIevPnalZC9/Vt/2oCkaFImpNF5z8yqv5CHPs@lists.postgresql.org X-Gm-Message-State: AOJu0YyBPu5B/JTWx4I8A8mePLJFZgxkI85vIVrFWheolvl/Ve9Rmvdt dotvmCqAzwocLKt6psaCUIY8vo2MAd5UPH7+INseljkTvt2D2h2cGpnB X-Gm-Gg: Acq92OFB8R+EO0RFeO8Jjfro5k0C5LApvSd5UXXb5MuWdIm6gPRT0gNdBbwrjByRVFn 2ez+PWSkBn7IlLthpqZGCrWditFzYICs1RW1afXnqUvN0VN1YMFBOC621hEJeK02yup2+uuRkn2 2rW4kX9D9r9s04BnwzD+KEVg1UxfqT4wXYecf2YfVi5QQ0ZxSf3t/+mKrbAHglgTuEW0Iw6L0y+ 44KoWXrlgYsMM57vQH77Gxx6le+c+Nah2u0ymCfLLxBH4APC9Axtd2nDigMMzve4SrmBn/REB9Z +ixYcj+TlxNg58g9Mmp3xWyqqMBOwtjng2pKPUmZ+Mfl2bzOLTJuHawK5zZrjHDPl8yLU2uZWCx P2yudV6hwn8pXzv4pjzaw3Cy8RWkGBtpQ3FCUDN4L0zapMauZB71TE7JyGegRyxxutO/uywxO4F 8CQKt/SOuue7T/ViZddzecwwSMznQLqQfg29Zhveq07VbUwXB60MsMuqRnlcra4t6LuBcJHTXgD wPDiEk9SP2clGMlEbk3SQ== X-Received: by 2002:a5d:5f90:0:b0:460:1c93:6eb6 with SMTP id ffacd0b85a97d-46032daaee2mr24933301f8f.20.1780987628968; Mon, 08 Jun 2026 23:47:08 -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-4601f35fb24sm62992585f8f.34.2026.06.08.23.47.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2026 23:47:08 -0700 (PDT) Date: Tue, 9 Jun 2026 06:47:06 +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: multipart/mixed; boundary="v3Mz6usoBDMzPHnY" Content-Disposition: inline In-Reply-To: <71eb9a8835a28165939da567a9d649fe6d21bfa7.camel@j-davis.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --v3Mz6usoBDMzPHnY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com --v3Mz6usoBDMzPHnY Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v25-0001-Recheck-permissions-after-lock-acquisition-in-de.patch"