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 1wVBhm-001lfk-2T for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Jun 2026 17:18:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wVBhl-0084j3-2N for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Jun 2026 17:18:05 +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 1wVBhl-0084iv-1U for pgsql-hackers@lists.postgresql.org; Thu, 04 Jun 2026 17:18:05 +0000 Received: from mail-dl1-x1236.google.com ([2607:f8b0:4864:20::1236]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wVBhf-000000016fU-3hko for pgsql-hackers@lists.postgresql.org; Thu, 04 Jun 2026 17:18:04 +0000 Received: by mail-dl1-x1236.google.com with SMTP id a92af1059eb24-137f3cb3f46so1541477c88.0 for ; Thu, 04 Jun 2026 10:17:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20251104.gappssmtp.com; s=20251104; t=1780593479; x=1781198279; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=w/qFRRzSkbyUfs6Z1PFZigv98EwbmUndnChT8dwYWZo=; b=o5cQACCOyRTm9BQA5md07Ds5qhEngLOVyAZkY2HH7CufjgMGGjJD9jHOXTVTFSKEK+ mQgdaUnYt8tnQx9XsboeQ/KlLmE6Nv4XRq4+rD2PpzZh4LLGXsTPqriaJquxaa9MF7ww 973zXmk1FWYAAqIs7dt0xv8nh8WaBZN0E84flFkF1vU9mWQaBp5xiPY/R4XykbL+t2Ex xgaFX9nLV8stQcJkmKZaafCW/lUTiCYwW6xOtmYtmCp0/3dllOCyjhyR/WS7c2633XwW GPPTXvZYjDoNkTv1VHpZNJuKLf+5OpZHRlORtvCcgrKUKebFzwC1hbeBea4v72IZ9zfb iVyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780593479; x=1781198279; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=w/qFRRzSkbyUfs6Z1PFZigv98EwbmUndnChT8dwYWZo=; b=C2fb3ydC4OoJM/bom2RRx9mSHEqePdhaMq6441qeVl5jDmapGIfEM/pQCbciowKLAw XBZB+61zSUg/XkMCQbLSxa7GIx7rYNigZg8jyGKSo9ACBJsph7gbpYjjxGB3nI7Z9rHs ISgi0NA0Cox+7VJ0LZYGRVn5pYS4v3MPjnmSV3aF1sNzj6jZ42o/k7wGhRipSnbAj1l1 khvfOgU0IGYbhcwFAhaajtZ5CfR2/FxY7Tm0HC9B4vqSWbFMiZcG50igt/ZcoF8qwnLS 71QiH1aJcr+IjO8r+g0m7HrScb+gcIYDMSGgEKLYJ97K0DFIP91IRFkXUTEPGZySmj48 KyDg== X-Forwarded-Encrypted: i=1; AFNElJ8FMK5Mw1pKB1A2nj32yeml2vQMJc9/BCBBRTxnHiDD2qcZf3fRpadZim7yN/cDuKuti56g9yDbXzvivB2W@lists.postgresql.org X-Gm-Message-State: AOJu0YzqqCXSe4Kqf37jmfbVxjNQepTaTniISu6QsExZHyPUXUhiSQ5C iCCznT1vw+ik6O/qIJ3pgcjOHOo112dJPFRteJ7EW3u3MzuG/B3+c6uasBFfTqmATQ== X-Gm-Gg: Acq92OGM8M8Si9huOxNZktrbQ/+7rDa1xT6IulzYAiaMMUW5Kgx8NEAz6ATnizGtDZ5 HOx8kBFaBYDHx7XwiRwPvlZHVOXRcBLD5zwxBtGNwN1CtrWzXCNpqVcvNjAAvCObewGqqyt2lOi 9NabwMk4wcdnLgz1ndKvmYSw2efh8RgiPYspkLQuQBgI7YCwN+MwphvSCfBMuWG97fhfTE7ia3p xvXN7acnYBl+tUom2fqqN6XHoaStqyTEpS0gvMAvVT07aYsFpmPEvotvaWtjFbRtKFmgR79NHK8 n2SLxT1w0IEVomFcsmCUvSCNxwyYr4jusk/IdoEbe8Odb2ZSGdbKm25/vOgAXBNpchpAs3ABaRF kqX4Xy/ADsb/8RmFEJfkJVnIvU8PhQf+GK+/Vkp1A/nvbcLXM5M9zhsovbqhEFUGdZp+hHKtviY E9Adpe1jttjyjJrkA9ZD1W39PFTG7J9xKRJhLZCMEHAk91417qkkZxPl5BU+TVoPiT3Pab27C/K De3Vg== X-Received: by 2002:a05:7022:45a1:b0:137:8db3:73b9 with SMTP id a92af1059eb24-137f6c3ba51mr4628897c88.41.1780593478970; Thu, 04 Jun 2026 10:17:58 -0700 (PDT) Received: from jeff-ws-bridge.lan (c-24-7-19-3.hsd1.ca.comcast.net. [24.7.19.3]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-137f5489d17sm3991307c88.1.2026.06.04.10.17.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2026 10:17:58 -0700 (PDT) Message-ID: <44220da166d8f1ef74b2bf76c60a7663dcf9dc07.camel@j-davis.com> Subject: Re: Avoid orphaned objects dependencies, take 3 From: Jeff Davis To: Bertrand Drouvot , Heikki Linnakangas Cc: Robert Haas , Roman Eskin , Michael Paquier , Alexander Lakhin , pgsql-hackers@lists.postgresql.org, Tom Lane Date: Thu, 04 Jun 2026 10:17:57 -0700 In-Reply-To: <5315d15a42109297259d1a3264ad09e363eb98df.camel@j-davis.com> References: <9f5f0dd4-96d5-4d90-9436-62d96e0298f9@arenadata.io> <3963e573-4852-4d25-b741-7c5c7e1f9140@iki.fi> <5315d15a42109297259d1a3264ad09e363eb98df.camel@j-davis.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.3-0ubuntu1.1 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2026-06-03 at 11:08 -0700, Jeff Davis wrote: > RangeVarGetRelidExtended() coordinates three things: >=20 > =C2=A0 - name lookup > =C2=A0 - lock > =C2=A0 - ACL check >=20 > whereas recheckAclAndLock() only coordinates the latter two. Given that we don't do another name lookup, the object Oid doesn't change, and it's not obvious why we need a loop in this path. A sequence like: Earlier during DDL processing: 0. Name lookup and ACL check (and track ACLs) When recording dependencies: 1. Lock object 2. Check that it still exists, error if not 3. recheck tracked ACLs, error if failure could work too, right? I see why you might want to do the checks while not holding the lock, but it doesn't seem like a requirement (if the user doesn't have permissions it should fail quickly and release). In any case, it's worth a comment explaining why the loop is there. Regards, Jeff Davis