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 1uMlZY-0037aX-7L for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Jun 2025 10:42:16 +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 1uMlZW-00B2oC-AX for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Jun 2025 10:42:14 +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 1uMlZW-00B2o4-1U for pgsql-hackers@lists.postgresql.org; Wed, 04 Jun 2025 10:42:14 +0000 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uMlZU-0009Ze-2k for pgsql-hackers@lists.postgresql.org; Wed, 04 Jun 2025 10:42:13 +0000 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-551fe46934eso902766e87.1 for ; Wed, 04 Jun 2025 03:42:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749033731; x=1749638531; 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=2Rmpi2FjbR8tnWhWFDcDJTSPddiFXxjC1eoo7ekZOo8=; b=lh/YDYzDG3C0ADqBd45wT5kdr0x9+z17ZNdNyvhawa9yiYK5NkU5gTrq7ahCsvnIi9 gOvt49puFzRIeH8LRM6UQ0FqQQ1ivWhn2iojTgCAJJ2FH5Lhn87AOrGlfLStkMKmnnzQ DFRsdp1j6ARoq8YHY6Dzel+nJJ76mW0213Pn3Oucf9mLWMNohe7pjZ4v9iJcopOpOSQ/ sJCQU4f+pe1a9tpcdhiMybOFLp0wTF5/xFMvW78HBt384Vj00fgYKUQYOjhYxuk4TpXW pshn+NyzzF2rtiU/a6/mJRGZLowb/mZA8NDShruutbvQoSltuw26iWlw+hNH69RWSh9n OMBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749033731; x=1749638531; 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=2Rmpi2FjbR8tnWhWFDcDJTSPddiFXxjC1eoo7ekZOo8=; b=iPt0DdmLkVL+xWYziVFj7pwheTlcbUujmlVq6PJmmwcJ7wE4+VNp6w3SPN2d3v0mpY e+ewfg8Qz5D7ZZdebfBrzkUJ0HknowmTthS6+mu9uzd6CNvcuGEgqQHfQpCnbpxPydpi nYVjzDMt3DvOAcJawgA59jkCPhWu7LzKvIUBqCrlPWVeISFhAJnUWvYv7Ic97DRSReag MzlJs+hu33KGEmfTg1Bgn8eU0QbJhLVc3m/6ZzPQG79/JhjoUz/w2RLJ90t7FRkUxf+t noXVcnnLiBE0unI/1Cz2bgEk+II5qzhIxbAy7IFEprn296FnNFgZ8fDX/AkVYz05pDua 9UyQ== X-Forwarded-Encrypted: i=1; AJvYcCXB6laQ7TnM6smBvUVsdg31mW2lYfoJ61mQGTWuDhThB2BeaELuqnJp6ojRwPIxGv43SJTl8Cv/NlUIZ3dS@lists.postgresql.org X-Gm-Message-State: AOJu0Yzt+cf8qzGvFdJSe42aNx0MpmdyOpvDqcm/LS3A0tPrQ8Ke4oz2 AdxBfMdUaIygWI1UnjF/0QhvR6vZ1Ko9klykTlBOtMo4Mq5KECjK6vTAIfyMjiYpsVChJCYS5j/ 8j8BITEtldVjox4hOG7spQ4NSKzHPMGc= X-Gm-Gg: ASbGncvP5uynu3v3bYXR/0vqPe0JheXQzhdlz86sgBwvhsNTeTXUoCEF08v1NL7HQiH zns8UjHRzKaVj2KF+ePd7wsTqxmxJrmuX6w0bNF7hJEODXmVyzPalGxO1ieP2rOzPTWUUleM+u5 9kb3Lo6LqTL5zbm6YDLyE5lRYyGqOlwbwB4z4WVAOQdHU= X-Google-Smtp-Source: AGHT+IGoghbO46BzKyPGrYOt6V0QA7/2TWalYlH8BWkNmryTqWBT+du41J/9faxN5E+JR/BtVbElZcQblp7BwnGRvkQ= X-Received: by 2002:a05:6512:3b8e:b0:553:3201:8d23 with SMTP id 2adb3069b0e04-55353164ddfmr1813539e87.9.1749033730947; Wed, 04 Jun 2025 03:42:10 -0700 (PDT) MIME-Version: 1.0 References: <202505101759.6qlloepaeddl@alvherre.pgsql> In-Reply-To: From: Ajin Cherian Date: Wed, 4 Jun 2025 20:41:59 +1000 X-Gm-Features: AX0GCFt5VwjR8U69HHLWp6lI7IzYECsjVV0Ucp37Zo4KfF96mHfJbKdZkGpYA9E Message-ID: Subject: Re: Restrict publishing of partitioned table with a foreign table as partition To: Shlok Kyal Cc: Amit Kapila , =?UTF-8?Q?=C3=81lvaro_Herrera?= , 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 Tue, May 20, 2025 at 2:33=E2=80=AFAM Shlok Kyal wrote: > > This approach seems better to me. I have created a patch with the > above approach. > > Thanks and Regards, > Shlok Kyal Some quick comments on the patch: 1. In doc/src/sgml/ref/create_subscription.sgml: + has partitioned table with foreign table as partition. If this scenari= o is + detected we ERROR is logged to the user. + + Should be: "If this scenario is detected an ERROR is logged to the user." (remove "we"). In src/backend/commands/subscriptioncmds.c: 2. The comment header: + * This function is in charge of detecting if publisher with + * publish_via_partition_root=3Dtrue publishes a partitioned table that ha= s a + * foreign table as a partition. Add "and throw an error if found" at the end of that sentence to correctly describe what the function does. 3. + appendStringInfoString(&cmd, + "SELECT DISTINCT P.pubname AS pubname " + "from pg_catalog.pg_publication p, LATERAL " + "pg_get_publication_tables(p.pubname) gpt, LATE= RAL " + "pg_partition_tree(gpt.relid) gt JOIN pg_catalog.pg_foreign_table ft ON " + "ft.ftrelid =3D gt.relid WHERE p.pubviaroot =3D true AND p.pubname IN ("); use FROM rather than from to maintain SQL style consistency. 4. + errdetail_plural("The subscription being created on a publication (%s) with publish_via_root_partition =3D true and contains partitioned tables with foreign table as partition ", + "The subscription being created on publications (%s) with publish_via_root_partition =3D true and contains partitioned tables with foreign table as partition ", + list_length(publist), pubnames->data), I think you meant "publish_via_partition_root" here and not "publish_via_root_partition ". regards, Ajin Cherian Fujitsu Australia