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 1s7A3G-0041k9-GV for pgsql-hackers@arkaria.postgresql.org; Wed, 15 May 2024 08:31:55 +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 1s7A3F-00C2hl-8c for pgsql-hackers@arkaria.postgresql.org; Wed, 15 May 2024 08:31:53 +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.94.2) (envelope-from ) id 1s7A3E-00C2hc-VT for pgsql-hackers@lists.postgresql.org; Wed, 15 May 2024 08:31:52 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s7A37-000KkF-30 for pgsql-hackers@lists.postgresql.org; Wed, 15 May 2024 08:31:52 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-41fd5dc0439so44331125e9.0 for ; Wed, 15 May 2024 01:31:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715761905; x=1716366705; 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=mCkJRw/fLWAhoDimZTM+4BktfDW2303KjsfQXvdedt8=; b=ZUcd/RGhBD4q0OEV+1IMFa0zp9KoYPxMWU0RlvA2Mf7Ik+2wJlfsQOCK8BIjZof7bM V54woI6yK68sTnvs4XHaKWlOKq483EQFL/FzVnsb1Gh9/Lc+i+ljKL37d7UQhh77RWtK o8U6r0UmG5TcsvnsS0YqIylLpRuIRHBb55w0AcMMtZhpYNyzooY2/DriLlDiQt4ITkaM 0Y12Y9EBrrsB7e89/Xa7VoSi8/xgJaQ+UdVN/ajVNONdT01jdJSIUm0CrzLp3npkw+Lh Zd10sAseDiR+CFyD+iQU+m9uuVc4mreI27HO7IxTZJziB2R0z2D3YaLk+Atd8/a4rAcb KKKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715761905; x=1716366705; 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=mCkJRw/fLWAhoDimZTM+4BktfDW2303KjsfQXvdedt8=; b=amFRaFthuhM9yxnmlEaK363fH6OYZFmZ5SionkReLFRRKXvHSEQ01sIMx1ncM/X9u1 1NNiGkkqVcYtfNXaFl+JiPMMnpH9snHZ0OkwFw4yuB1vuAuiScpfusO0Kckz8jrWdTBP QdMSFDtH65Q/LhC2MkBoRezMPO9lsmDm+p/rbqrgg/iF9Jc+kEEgoJ1QJZongrUblehg wsrRJagWzJ/s66Ii63Ql3npou+zE22kOtx3Vz4ooAWkPmCypOUCBu/L7sdQXrGMTOMz/ Edem5aCjhFdRKJ7tSsY34oqZCuG5TLkAZYEEhV8KHCI1dk09IRNsfLLedwWHqXJiiv/f dOyw== X-Forwarded-Encrypted: i=1; AJvYcCVvRXVN+XVTVGBtLM/IC0xmkNpG2IL5via1MGkDCi7TO7xjWVQt2Y0iYtYyAFci1AnMihQSdZ2YyT6p36pbOST/qsSNR1QyA2Wo1bItT/8DLYW3 X-Gm-Message-State: AOJu0YzxrCi1Hat/6ZlO9T66TJU2mVwkoLthZLMHkTDSY/VgeUlOG3Fw GUNBqSyN+jdFzFEz3V4y3lJfVPRlO2iYMsjiTPdW7BbuIqY1zauQ X-Google-Smtp-Source: AGHT+IGUhT9NZu27TximKX6CVHmvr8T5nP5izR3ZzBSgNxvVCEcBI+x/kNRPD66T9WF2uE6y8uIXjA== X-Received: by 2002:a05:600c:4e88:b0:420:1551:96a9 with SMTP id 5b1f17b1804b1-420155198b2mr61632665e9.39.1715761904835; Wed, 15 May 2024 01:31:44 -0700 (PDT) Received: from ip-10-97-1-34.eu-west-3.compute.internal (ec2-15-236-134-5.eu-west-3.compute.amazonaws.com. [15.236.134.5]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fd491c712sm126734805e9.0.2024.05.15.01.31.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 01:31:44 -0700 (PDT) Date: Wed, 15 May 2024 08:31:43 +0000 From: Bertrand Drouvot To: Michael Paquier Cc: Alexander Lakhin , pgsql-hackers@lists.postgresql.org Subject: Re: Avoid orphaned objects dependencies, take 3 Message-ID: References: <62310067-6dc4-97ab-6724-7d3602b5056d@gmail.com> <403075e1-4d60-09e2-a06a-749cd9d88f66@gmail.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 Wed, May 15, 2024 at 10:14:09AM +0900, Michael Paquier wrote: > On Thu, May 09, 2024 at 12:20:51PM +0000, Bertrand Drouvot wrote: > > Oh I see, your test updates an existing dependency. v4 took care about brand new > > dependencies creation (recordMultipleDependencies()) but forgot to take care > > about changing an existing dependency (which is done in another code path: > > changeDependencyFor()). > > > > Please find attached v5 that adds: > > > > - a call to the new depLockAndCheckObject() function in changeDependencyFor(). > > - a test when altering an existing dependency. > > > > With v5 applied, I don't see the issue anymore. > > + if (object_description) > + ereport(ERROR, errmsg("%s does not exist", object_description)); > + else > + ereport(ERROR, errmsg("a dependent object does not ex > > This generates an internal error code. Is that intended? Thanks for looking at it! Yes, it's like when say you want to create an object in a schema that does not exist (see get_namespace_oid()). > --- /dev/null > +++ b/src/test/modules/test_dependencies_locks/specs/test_dependencies_locks.spec > > This introduces a module with only one single spec. I could get > behind an extra module if splitting the tests into more specs makes > sense or if there is a restriction on installcheck. However, for > one spec file filed with a bunch of objects, and note that I'm OK to > let this single spec grow more for this range of tests, it seems to me > that this would be better under src/test/isolation/. Yeah, I was not sure about this one (the location is from take 2 mentioned up-thread). I'll look at moving the tests to src/test/isolation/. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com