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 1tFyrU-000DAn-16 for pgsql-general@arkaria.postgresql.org; Tue, 26 Nov 2024 16:56:28 +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 1tFyrS-008Bzk-Ll for pgsql-general@arkaria.postgresql.org; Tue, 26 Nov 2024 16:56: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.94.2) (envelope-from ) id 1tFyrS-008Bzc-B1 for pgsql-general@lists.postgresql.org; Tue, 26 Nov 2024 16:56:26 +0000 Received: from fout-b7-smtp.messagingengine.com ([202.12.124.150]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tFyrP-004AXU-C0 for pgsql-general@lists.postgresql.org; Tue, 26 Nov 2024 16:56:25 +0000 Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfout.stl.internal (Postfix) with ESMTP id B6D1E1140199; Tue, 26 Nov 2024 11:56:21 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Tue, 26 Nov 2024 11:56:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1732640181; x=1732726581; bh=/NmpyqESBh7NlDP5UNrdt7Oh0z63M8ha309A7jxA7dU=; b= jdf901hKIK6DMoIrDNN8D7p3s0URKlZNuvPlqFSo4A8Zl1NbID+LqLv128X5rWOJ 1soSqHgye6pSJz1JUMHxrbV6HTQR5whNNW5g8HANbQUI9++CJIYlFUmH40z8nJ/z IgzRQBgL44wqnhxBrsFIPJAcSqTlKCCkrlg1N+Kb2YXu9pRnq0L1EtRJq3hVKKFp 5iFLmyy+XzNe/usUXfeI3Y1u34LRT+xh/JgJXRtISRMnEdR/xLINPBu75zzJe/Ru DRr3pYCUlMa749FNZUCtKTt3tUnp1/TeJyqejK5ndLiIOgpna2oFuXI2TueDkIhG G5M6XYVJE4zZKcy0OZ4pUQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1732640181; x=1732726581; bh=/ NmpyqESBh7NlDP5UNrdt7Oh0z63M8ha309A7jxA7dU=; b=SzddfQSLqUE4+wEt1 yv7ymraeUHIDVZk51CwZUXGIml2yhDk7E+89xzFUTxViCWVfGXcfJyBv09HrbCaN 9LV1chL4VfG4xMna/ypEhUMLv95D5pqBjJxaYLSMhkYy3FmWMD5uBimsQTrAmPbe OdPSpLcGr+30w/J1aByyi3F7SeQugSFWxXOFVu/StWJouCgjLPMbYl9MergtY41w okL5hj0+16UnK3Gkq/tzq0gE2xj9MLpZ9r6RTfwvJE18imLH9VI15SzQBe3N4H6P kC4mLwbaBWHgmDVfUnT3SvkzV0S7nctqflNcwaJl6nn2wOuWsxAh7gq6yt2jmTCu octgw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrgeejgdeltdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtvdejnecu hfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrg hklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepkeefheduvdejiefgieefjedt udduffelvdefleehfedtieffuefgvdekleegtddvnecuffhomhgrihhnpehpohhsthhgrh gvshhqlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmpdhnsggprh gtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehprghulhdrfhho vghrshhtvghrsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqghgvnhgvrh grlheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 26 Nov 2024 11:56:20 -0500 (EST) Message-ID: <78ec2af8-48f2-42c0-b317-cbb77cc5adc8@aklaver.com> Date: Tue, 26 Nov 2024 08:56:20 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: PostgreSQL 15.10 update corrective action for ATTACH PARTITION/DETACH PARTITION To: Paul Foerster , pgsql-general list References: <5456A1D0-CD47-4315-9C65-71B27E7A2906@gmail.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: <5456A1D0-CD47-4315-9C65-71B27E7A2906@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 11/26/24 01:59, Paul Foerster wrote: > Hi, > > I have a question regarding the recent security update for PostgreSQL 15. > > We have a gitlab database. It used to run on the PostgreSQL 15.8 software. I updated from 15.8 to 15.10 and executed the corrective actions as outlined in: > > https://www.postgresql.org/about/news/postgresql-171-165-159-1414-1317-and-1221-released-2955/ > > I executed "SELECT conrelid::pg_catalog.regclass AS "constrained table", conname AS constraint, confrelid::pg_catalog.regclass AS "references", pg_catalog.format('ALTER TABLE %s DROP CONSTRAINT %I;', conrelid::pg_catalog.regclass, conname) AS "drop", pg_catalog.format('ALTER TABLE %s ADD CONSTRAINT %I %s;', conrelid::pg_catalog.regclass, conname, pg_catalog.pg_get_constraintdef(oid)) AS "add" FROM pg_catalog.pg_constraint c WHERE contype = 'f' AND conparentid = 0 AND (SELECT count(*) FROM pg_catalog.pg_constraint c2 WHERE c2.conparentid = c.oid) <> (SELECT count(*) FROM pg_catalog.pg_inherits i WHERE (i.inhparent = c.conrelid OR i.inhparent = c.confrelid) AND EXISTS (SELECT 1 FROM pg_catalog.pg_partitioned_table WHERE partrelid = i.inhparent));" which gave the result below: > > > -[ RECORD 1 ]-----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > constrained table | p_ci_pipelines > constraint | fk_262d4c2d19_p > references | p_ci_pipelines > drop | alter table p_ci_pipelines drop constraint fk_262d4c2d19_p; > add | alter table p_ci_pipelines add constraint fk_262d4c2d19_p FOREIGN KEY (auto_canceled_by_partition_id, auto_canceled_by_id) REFERENCES p_ci_pipelines(partition_id, id) ON UPDATE CASCADE ON DELETE SET NULL; > > I then executed the two alter table statements without any problem. No error was reported and all seems ok. > > Now, if I execute the query to find the constraints again, I would expect the result to be empty. But it is not. Did you commit the statements? Are you using concurrent sessions to do this? When you run the query again do you get the same two statements? > > Why is that and what am I supposed to do? Is the problem fixed now or is it still pending? Any ideas would be greatly appreciated. > > Cheers > Paul > -- Adrian Klaver adrian.klaver@aklaver.com