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 1st4DH-00DHKg-1W for pgsql-bugs@arkaria.postgresql.org; Tue, 24 Sep 2024 12:00:15 +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 1st4DE-0074qh-3l for pgsql-bugs@arkaria.postgresql.org; Tue, 24 Sep 2024 12:00:12 +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.94.2) (envelope-from ) id 1st4DD-0074mB-Pn for pgsql-bugs@lists.postgresql.org; Tue, 24 Sep 2024 12:00:11 +0000 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1st4D7-000nuV-N1 for pgsql-bugs@lists.postgresql.org; Tue, 24 Sep 2024 12:00:10 +0000 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2f763e9e759so62094571fa.3 for ; Tue, 24 Sep 2024 05:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727179204; x=1727784004; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=pnf2N8pHxuAsQAdqkNjtwXE9LwQffQAdZ0O3A9FMN/Y=; b=aKoljr7cCok6edcs22Q5ciEDJhTxLQBmthgui1tOKXN5dKH0HCavYIVv8qTDkaGLbY L8lrydJsKXJRX18fs6NRL0MU62fozJEWTJ09bveTKg/GR25vge36zfPJvPjJNZ5tSDAE o8PLmGeFZjM8BdK2p5n8jALBGXujxac3BpzjV/BeJl/kHsjP+GFSfYyfkQeSghC+9gz3 SwvKIeb/Rq293sQJNOFaLkFkDJnJTsf5+2BG+JEcJ9EhFp9IX3DMsJV1ZDmhEeWV4Y3K nJ5bo3VzqgmodCvL9YTe6LDUjBgl8zn9FURR/MVftLYWyB2CHJcGqKULwwUOusUOrr2L 911Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727179204; x=1727784004; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pnf2N8pHxuAsQAdqkNjtwXE9LwQffQAdZ0O3A9FMN/Y=; b=sgCbaV7vGmXOFbaLLlScMnapaTnRgS+YJ0yyrM154jXo5FMVBAHTjd+plbYz77IgHf IeOw+P22TmT8K7uBDkJ4pQnxWM+VZ+R1PLmmsPG3ZauagQmzhHSr6N/5yxcKJ7yVbRfr 267BUpuxlGbDs+4a8ckCL676UMKqMFThFjw+ueAAfLHgCcW7duSe4V0VesanNc8VF2Gw rTCJ0oARW3Jas2iQ5bz04Ml9ykAK7tjIasV/BcRdFfa8ZH5nDo5pNhbBGg6jCbL/Ob09 XLbIoPi77XPR2xtY+O4V4imBkkjGRzPyZ49u7v3rDKhvVZb1lKeRbdr7j5aIocDYc0E4 js8Q== X-Gm-Message-State: AOJu0YyPNF8F066zeuhKSnph9Xk6lBcopaEUQxMavsz7HlVjfpX2++xR AX3G7m8fL17GKUmeJqXJpb8PP6vq/axDHlEYgBdswmfJmHgI4uAP X-Google-Smtp-Source: AGHT+IEH0x7PeSENq9xl4pxsoopzYi+cg8OIG4mTsoIkM14AcZgp+DczmTb5aJFX2s5xwypk7amBlA== X-Received: by 2002:a05:651c:211c:b0:2f6:61f3:c618 with SMTP id 38308e7fff4ca-2f7cb37efbcmr69919981fa.43.1727179203667; Tue, 24 Sep 2024 05:00:03 -0700 (PDT) Received: from [1.0.0.7] ([178.155.20.161]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2f8d282fe23sm2074801fa.20.2024.09.24.05.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Sep 2024 05:00:02 -0700 (PDT) Message-ID: <4fe75dda-d8cc-1763-9741-e1efdaed33d4@gmail.com> Date: Tue, 24 Sep 2024 15:00:01 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: BUG #18628: Race condition during attach/detach partition breaks constraints of partition having foreign key Content-Language: en-US To: Alvaro Herrera , tender wang Cc: pgsql-bugs@lists.postgresql.org References: <202409241123.dnrn6pdmoud6@alvherre.pgsql> From: Alexander Lakhin In-Reply-To: <202409241123.dnrn6pdmoud6@alvherre.pgsql> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 24.09.2024 14:23, Alvaro Herrera wrote: > I suspect this is the same problem that was reported by Jehan-Guillaume > de Rorthais, for which there are two patches proposed, his and mine: > > [1] https://postgr.es/m/202408072250.2c4fkhwf56lk@alvherre.pgsql > [2] https://postgr.es/m/20240905005728.0836d609@karst > > I haven't looked at his patch, but I suspect it's better than mine on > maintainability grounds. I think his code causes more catalog churn, > though perhaps we don't care too much about that in this particular Yes, v2-0001-Rework-foreign-key-....patch works for me — the partition detached with no error. Sorry for the noise again. Best regards, Alexander