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 1qd8kY-002Jp1-BX for pgsql-hackers@arkaria.postgresql.org; Mon, 04 Sep 2023 12:32:14 +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 1qd8kX-00B2S1-5n for pgsql-hackers@arkaria.postgresql.org; Mon, 04 Sep 2023 12:32: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 1qd8kW-00B2Ro-Qs for pgsql-hackers@lists.postgresql.org; Mon, 04 Sep 2023 12:32:12 +0000 Received: from mail-vs1-xe2d.google.com ([2607:f8b0:4864:20::e2d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qd8kT-002gJf-Pb for pgsql-hackers@postgresql.org; Mon, 04 Sep 2023 12:32:11 +0000 Received: by mail-vs1-xe2d.google.com with SMTP id ada2fe7eead31-44d4c3fa6a6so548678137.0 for ; Mon, 04 Sep 2023 05:32:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693830729; x=1694435529; darn=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=L9TIeAxHEkVR0vcQ8FBzB2nWkJuJ889zUibz0mNgY4o=; b=TjdjOYH42/yGlRWsxA29r2TDjsUr0tqNJ/PLKTwvBMCghzUDhMxjVgtHdH0qpMyaY2 21r7FAr7fwuuCt80DpNRj+DSyOZKRzumqdswKI8zbq3EQA1bCovvmAD2NyZMstojOut4 NDd2QlXVsX/k2wW8Ot8SgXACo288jo/VAnDLSTGQKyRofnwBXGnQwptq1wvX4KaPRfQi UkKpgQOQoBLExw0l0QQtcKvQtezDSsnSSw4scm5wgrseDR/mmefBeYIWxP1w80hv7y5K V9NLfZ/FM8ZFiOLeqoVq7NEY9j629jS5G4uT7HklQOOOzvvx2puFSmJGc8uO52iAc6GS XPXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693830729; x=1694435529; 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=L9TIeAxHEkVR0vcQ8FBzB2nWkJuJ889zUibz0mNgY4o=; b=VCcdn3pEZA8BgAo6l+Y4NPH9JgPn7TvORveX2oqzTXKwSY9fyF3lPG56kAxZpHrQY5 3kH4Aby6cPiW5YwR0zbORzMtmS2VmB8RaaHegQDjuOyTqa4pU0PsswrDINiF/gapbiyE P/nDNlShDY2ppM7PSqoNhisVZmEtBPUcQfiSEVM2aiWNprKuH9nYMLoVo5N8ECpDvV7v EdIc40GsfLx0e/NmnbCM7e7Dkrtv7qtDEYSpP+IOODE7LEJEjvvkEXp+5S3K3vwv+Fcl sdSrZ0cD1hDlOmkLHKTNwuy7EzcMeJGGZiV6ekxzl5mIgmRyt3xHJtd1KWSTai0bTllE wOeg== X-Gm-Message-State: AOJu0YzugITsQkn8SJrRIqz2SwYcyQSvekqYd9rJn36aGlTFGh3BG6VW F73t5zeONuoGpmBdcQT1Ht6IhZt1tW9AeVd+tKg= X-Google-Smtp-Source: AGHT+IE+faCk6S6TfWjxLjyYG3CCckK50ifSYPBtT8hRBG18netlgGPuAiekP/MkrIj+sbAQhnxsGwEfhV6MbglMtVs= X-Received: by 2002:a05:6102:89:b0:44d:41bc:705f with SMTP id t9-20020a056102008900b0044d41bc705fmr9382410vsp.16.1693830728907; Mon, 04 Sep 2023 05:32:08 -0700 (PDT) MIME-Version: 1.0 References: <149ff9264db27cdf724b65709fbbaee4bf316835.camel@j-davis.com> <830a2bc6cbbb2e6e01c6c0d9f31f320822e10603.camel@j-davis.com> <433d0845248e86c0317d9d396926182cfe157340.camel@j-davis.com> In-Reply-To: <433d0845248e86c0317d9d396926182cfe157340.camel@j-davis.com> From: Ashutosh Bapat Date: Mon, 4 Sep 2023 18:01:57 +0530 Message-ID: Subject: Re: [17] CREATE SUBSCRIPTION ... SERVER To: Jeff Davis Cc: Joe Conway , pgsql-hackers@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 Sat, Sep 2, 2023 at 12:24=E2=80=AFAM Jeff Davis wrot= e: > > On Fri, 2023-09-01 at 12:28 +0530, Ashutosh Bapat wrote: > > Thinking larger, how about we allow any FDW to be used here. > > That's a possibility, but I think that means the subscription would > need to constantly re-check the parameters rather than relying on the > FDW's validator. > > Otherwise it might be the wrong kind of FDW, and the user might be able > to circumvent the password_required protection. It might not even be a > postgres-related FDW at all, which would be a bit strange. > > If it's constantly re-checking the parameters then it raises the > possibility that some "ALTER SERVER" or "ALTER USER MAPPING" succeeds > but then subscriptions to that foreign server start failing, which > would not be ideal. But I could be fine with that. Why do we need to re-check parameters constantly? We will need to restart subscriptions which are using the user mapping of FDW when user mapping or server options change. If that mechanism isn't there, we will need to build it. But that's doable. I didn't understand your worry about circumventing password_required protec= tion. > > > But I think there's some value in bringing > > together these two subsystems which deal with foreign data logically > > (as in logical vs physical view of data). > > I still don't understand how a core dependency on an extension would > work. We don't need to if we allow any FDW (even if non-postgreSQL) to be specified there. For non-postgresql FDW the receiver will need to construct the appropriate command and use appropriate protocol to get the changes and apply locally. The server at the other end may not even have logical replication capability. The extension or "input plugin" (as against output plugin) would decide whether it can deal with the foreign server specific logical replication protocol. We add another callback to FDW which can return whether the given foreign server supports logical replication or not. If the users misconfigured, their subscriptions will throw errors. But with this change we open a built-in way to "replicate in" as we have today to "replicate out". --=20 Best Wishes, Ashutosh Bapat