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 1uFY1V-005gU3-M7 for pgsql-hackers@arkaria.postgresql.org; Thu, 15 May 2025 12:49:18 +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 1uFY1T-00EL4j-KR for pgsql-hackers@arkaria.postgresql.org; Thu, 15 May 2025 12:49:15 +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 1uFY1T-00EL4b-BF for pgsql-hackers@lists.postgresql.org; Thu, 15 May 2025 12:49:15 +0000 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uFY1Q-0021n2-2G for pgsql-hackers@lists.postgresql.org; Thu, 15 May 2025 12:49:15 +0000 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-b13e0471a2dso476796a12.2 for ; Thu, 15 May 2025 05:49:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747313351; x=1747918151; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=jbQkP8Sl8lYIbLKCUylLQp2dKstxwSzmny7+85vY/Tw=; b=MOOCGHR6bgGdsMeBEgSRCCNX9u3B/H5SLKMYDVja8grT262+0KNngGcNm3TmjqRb4j VYbGJdHR4F7baYh4LS6WOgL3aRytybaHvVMJwLVp3qBmhWJ+2r1e+t3ARQImpQ7NyxIj uiA+LqPGKwfzus1R8OZTUuGTxwVigggir+XD0G3yy1CMOYY8zan6JOQN1/QVOiofPt36 +zdECPcJuDah4yjOShyLKlvabiQpTIw8nT/G85M1BLHyjxbyLd0PTCI0H18Ma74FNe5e tq0fL8fQCIl2EeeuiD07S3HZ6CxiNtuCCZtHknWEoCHZVYjQlRw01n7GJMCBT+2q0/LW c8jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747313351; x=1747918151; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jbQkP8Sl8lYIbLKCUylLQp2dKstxwSzmny7+85vY/Tw=; b=qx9Sha36hMmoW3+zScw3IAZdL3Jmg5cQ4slp1VM1HTlJy3X3vKvXjh7Bt6miET5tfm 1YI2pk1JOSSo0BtXonBiTSaubcWtkN6l4P83voVd4bWu1WeoCQ/e9Ph7NGYm1utWppBi qzCvb5G3UGkWAw1tXJVXUV1XgxYmHNquvGJW6hBxCiv4+5b+F28LVM020zEBlBSpTvVB p4wCxumC818x4MqDdFG83XA/UGWlH9XL45x+VfbjEqTpxu1iXWts2JX2OQXxS3XUzL8V rorTSXCykwQ5kIBrVCseuVnFGyNo4GG+VIPgQm4jStmUjVHSWQ7klYsoox0M4XIBnpXj 6HLw== X-Forwarded-Encrypted: i=1; AJvYcCX27ZrGvSjgwzLibUxfL+E0xYC6FPRrXwJeCCtLt2BoVWN2gD03w5mhQdwfikUlJgDktoMsNgcCZNMnV/gn@lists.postgresql.org X-Gm-Message-State: AOJu0YxH+eCRoGsVqhj2zllpH86Dvy6iTCG/c/Mp5jUeuhU4e1R5CqTD XwGIaprjGTcjac+7NRJp4U5T7S9VH+XW55sqRli2BYQRJN/4PFvaYtOJdgnRXk0Zakn28jm6GTg q9MHDDFl9GXNjfWdWuYJSzxXx3s4= X-Gm-Gg: ASbGncs/kDsVLvaBwbih46YBfdpY1scim44raa6gKkDQdL8iuXvzl2vbuke2HRgImIH s2AsYV1iB3AJvTSbOXIU3/sQTlkCywnQ/25UGommE4YJTX6MZnbMNQUwvekznsMcq62el2kiFVF DulKTYPnmiQBGcKCdpuV7MgvPzQ3wQHsD7s+k= X-Google-Smtp-Source: AGHT+IF7xnfmzpgTz0Op+CKCFgT4djODXs/Dfsg2ClsJgwzxi+bw/firdZTGYbpXmVMlFtRLBJ+muyMKtUPeN5a8k+A= X-Received: by 2002:a17:90a:9a8b:b0:30c:5101:68b4 with SMTP id 98e67ed59e1d1-30e5194af11mr2440071a91.32.1747313350540; Thu, 15 May 2025 05:49:10 -0700 (PDT) MIME-Version: 1.0 References: <202505101759.6qlloepaeddl@alvherre.pgsql> In-Reply-To: <202505101759.6qlloepaeddl@alvherre.pgsql> From: Amit Kapila Date: Thu, 15 May 2025 18:18:58 +0530 X-Gm-Features: AX0GCFv3JXxKWRbYm0Bd0pYbt_8jq91nqW3QyoIOsgN_xwCe-C1qRMCc9cnvol0 Message-ID: Subject: Re: Restrict publishing of partitioned table with a foreign table as partition To: =?UTF-8?Q?=C3=81lvaro_Herrera?= Cc: Shlok Kyal , vignesh C , Sergey Tatarintsev , pgsql-hackers@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, May 11, 2025 at 6:53=E2=80=AFAM =C3=81lvaro Herrera wrote: > > But the non-idiomatic locking of pg_partitioned_table appears to > continue to be the pain point of this patch. My impression is that > using a lock is the wrong approach to solve the concurrency problem. > Maybe we can use a ConditionVariable instead somehow. (The real trick > here is to figure out exactly _how_ to use the CV, I mean what exactly > is the condition that the CV sleeps on?) > Can we fix this problem by having a check at the time of CREATESUBSCRIPTION such that, if copy-data is true, then we ensure that the specified publishers don't have a foreign table? We have a somewhat similar check for publications in the function check_publications_origin(), though for a different purpose. Along with it, we can still have a check during foreign table creation/attach that it doesn't become part of some publication, as the patch may have it now. --=20 With Regards, Amit Kapila.