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 1tzxD5-0097DZ-S0 for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Apr 2025 12:28:48 +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 1tzxD3-00DAqs-4P for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Apr 2025 12:28:45 +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 1tzxD2-00DAo0-Nu for pgsql-hackers@lists.postgresql.org; Wed, 02 Apr 2025 12:28:44 +0000 Received: from mail-yw1-x1135.google.com ([2607:f8b0:4864:20::1135]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tzxD1-002XzE-0P for pgsql-hackers@postgresql.org; Wed, 02 Apr 2025 12:28:43 +0000 Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-6ff0c9d1761so54761757b3.1 for ; Wed, 02 Apr 2025 05:28:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743596922; x=1744201722; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=8pc+6OAV7we8GyIq1Q04S9+asoxGqPCjm17wFyMtn0w=; b=BweQoHQAKRAx8C8GB6bIF7f/fLkR1tGjNt7vk7ctEOnM8n2S/502P4F0ZqsBL3uQQh pVERKv6Mfs9OkhkIOAmRm0ldFznYnj99X2sSYft7EqtbRUbu/GsDGfSxsSu9TnruMcG0 6MTxevxjt/JDrAKMRyr4cC9xctAibOcqV6HI/CKTd5hEx6J74wuy3S2BfjtDXzbrzfOT 9y3PrXq3KCMGmY5sZu541dZ+x/c0qp+x4Hv524KYHgo3iyL4SmRm6whGQ47ZhgMTJeIq 3z7FYOzGeTgol53M7JORlcl8RVImgu2Yv3j7a+oy2/bI3qZRrZrmLdK2Iq7GhpW8TcCC f/pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743596922; x=1744201722; h=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=8pc+6OAV7we8GyIq1Q04S9+asoxGqPCjm17wFyMtn0w=; b=qeDt3eeMzNB1L4wjevyNclg+lDWO43rvFfn+ButWk5Cl96WVszb6/hvYuly1nagu/3 QIijwmeFqNrCwoFmRcn5gfpl+k5HIh+mtZccMMFXaAuo4wBLEYyo+UCaJRhjC2XXxN40 uQ02xrKFutxkrfyg5I9N8/WMkcuRSjnxpHFmdhpeJTw78N3ZJ8awfStDQL+HPifaDskZ 8WZyyV4m/mHOwIpDYPyxnxiUOv4MlX1gyLjHKRTLioianCcLiV+ZcQQkuLQ7fQHNZoBS 4lXNK8xJDVj5nWnoHP3enHG0bLzspT25lPEk8mPywr9hi6ZqyvY3RQS2iDyJ5zRtnIs5 zmGg== X-Forwarded-Encrypted: i=1; AJvYcCWjz34grp0CKiKMC+veftjd4nMYmYfMCrnBcp+i2hb7w2vh9i//Rb2q0WBKYw1Pn0/9fEpxOAcFgiel9R/4@postgresql.org X-Gm-Message-State: AOJu0YzfeCUiLV93N3zrdQlK9fe9taBVEaUEk+zBKiNHpxFIjAg96hT5 QDeEseQ73OrZ+3jC/7ZxaYE1OOEEPSHxnIAbLWUPrGbf+q7eb2hTcV3fu8eSBFfwJyUVLi3KuP8 00RqaS71BbYLokDSmDOUx6PyFRCg= X-Gm-Gg: ASbGncuQgD8RkvKg5G5gsrkpz/tx4W+v2NGEYQ7N53CjejVJIaRqOM3/eidrNx+WuQr 4rPpZt85RUPQpY3/muSu7ed0JYk6vFsTFdLBqPm8PxUACjViKa0GxT3ZmznSsYNU3vomaM8iSXW ZOAjbpDHP3LkHio8ScaCiIB0c3d9oKuYshh9YkJw4= X-Google-Smtp-Source: AGHT+IExn0OFkD2x2tV17PwpX8QqbYT1py7AmaBsO1ixHg3oZKx1jmsQyvRcAqVkcIaMyoG9zpNMKq4RXu6psb6y9ks= X-Received: by 2002:a05:690c:4c0e:b0:6fd:369c:635e with SMTP id 00721157ae682-7025712b642mr234103687b3.16.1743596922029; Wed, 02 Apr 2025 05:28:42 -0700 (PDT) MIME-Version: 1.0 References: <149ff9264db27cdf724b65709fbbaee4bf316835.camel@j-davis.com> <830a2bc6cbbb2e6e01c6c0d9f31f320822e10603.camel@j-davis.com> <433d0845248e86c0317d9d396926182cfe157340.camel@j-davis.com> <05ae37abb207cd6bf6b126780024692d91402b0b.camel@j-davis.com> <93392ffa941ab0d436e19e0ab5d04d0e42c02d3f.camel@j-davis.com> <26be917cb07b6aa3ef5dd15f6b59d1b375ece6e8.camel@j-davis.com> <55201bd916e748acfc754c8f95880dae8e4e5ed0.camel@j-davis.com> <2a89b14a2b1622bffb8b137ca1f9ab7866f2d2b9.camel@j-davis.com> <61831790a0a937038f78ce09f8dd4cef7de7456a.camel@j-davis.com> <0910b47040406c1d24ec0150dafb5bae6b910ed7.camel@j-davis.com> <7338f22c4534322a08ab6ce9f879e2e308eb5e5d.camel@j-davis.com> <34fd5885b8245d1014f4426ea22af61229d42e3e.camel@j-davis.com> In-Reply-To: From: Shlok Kyal Date: Wed, 2 Apr 2025 17:58:30 +0530 X-Gm-Features: AQ5f1JokDi6LcoNzpJX0tE_1lyXQgTWCP8-FARoBvdZCgItQq37MCbgnXVzChFo Message-ID: Subject: Re: [18] CREATE SUBSCRIPTION ... SERVER To: Jeff Davis Cc: Ashutosh Bapat , Bharath Rupireddy , Joe Conway , pgsql-hackers@postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, 1 Mar 2025 at 04:35, Jeff Davis wrote: > > On Mon, 2024-12-16 at 20:05 -0800, Jeff Davis wrote: > > On Wed, 2024-10-30 at 08:08 -0700, Jeff Davis wrote: > > > > Rebased v14. > > The approach has changed multiple times. It starte off with more in- > core code, but in response to review feedback, has become more > decoupled from core and more coupled to postgres_fdw. > > But the patch has been about the same (just rebases) since March of > last year, and hasn't gotten feedback since. I still think it's a nice > feature, but I'd like some feedback on the externals of the feature. > > As a note, this will require a version bump for postgres_fdw for the > new connection method. > Hi Jeff, I reviewed the patch and I have a comment: If version is >=18, the query will have 'suboriginremotelsn', 'subenabled', 'subfailover' twice. if (fout->remoteVersion >= 170000) appendPQExpBufferStr(query, - " s.subfailover\n"); + " s.subfailover,\n"); else appendPQExpBuffer(query, - " false AS subfailover\n"); + " false AS subfailover,\n"); + + if (dopt->binary_upgrade && fout->remoteVersion >= 180000) + appendPQExpBufferStr(query, " fs.srvname AS subservername,\n" + " o.remote_lsn AS suboriginremotelsn,\n" + " s.subenabled,\n" + " s.subfailover\n"); + else + appendPQExpBufferStr(query, " NULL AS subservername,\n" + " NULL AS suboriginremotelsn,\n" + " false AS subenabled,\n" + " false AS subfailover\n"); query formed is something like: "SELECT s.tableoid, s.oid, s.subname,\n s.subowner,\n s.subconninfo, s.subslotname, s.subsynccommit,\n s.subpublications,\n s.subbinary,\n s.substream,\n s.subtwophasestate,\n s.subdisableonerr,\n s.subpasswordrequired,\n s.subrunasowner,\n s.suborigin,\n NULL AS suboriginremotelsn,\n false AS subenabled,\n s.subfailover,\n NULL AS subservername,\n NULL AS suboriginremotelsn,\n false AS subenabled,\n false AS subfailover\nFROM pg_subscription s\nWHERE s.subdbid = (SELECT oid FROM pg_database\n.." is it expected? Thanks and Regards, Shlok Kyal