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.96) (envelope-from ) id 1vxUMG-00GbJI-1C for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Mar 2026 18:20:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vxUME-008DBS-1b for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Mar 2026 18:20:34 +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.96) (envelope-from ) id 1vxUME-008DBK-07 for pgsql-hackers@lists.postgresql.org; Tue, 03 Mar 2026 18:20:34 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vxUMC-00000000E4i-3XMw for pgsql-hackers@postgresql.org; Tue, 03 Mar 2026 18:20:33 +0000 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-389fa5e55e2so103049131fa.1 for ; Tue, 03 Mar 2026 10:20:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772562031; cv=none; d=google.com; s=arc-20240605; b=E0ZKNcRFFguoOp2BBluJLmijXUi/UM6AJA4ibU/BKEMAPB0TLMubc80uod72KAZMhD hP2bnuSZ2vqZpfq3DAfiC0EmYwyvbmiGBDXjQBQmmYMksKYNR9ubmccCpakyVqRpMMba T85+b1UtXrfnfykRGZyPT1+xBSluPjn2HucztXBy2rQOtszIXYCCxmOWcmR8sxdsCzAC 8YM2F1vgKSr/WspEGdPTOKKrtTiJPLW7DUEwz61I+e9COC4Z0DLSbFnNj6d9IlS+jZ1n nWuiEtghBysaDmtorRG/uqKOkR4pIUDLsZcmknDtgB4dYoHV5V/+OKsKYc8CIdE9HHcT 7t4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=6/SNFrry+1SrlPUExw2mVOKpcPc+tEF53jGskDGRFQs=; fh=ULHAbWaQNaMskGYHjjKH2ZgfEcGcW/0oqY9B8UlNX5k=; b=hACr5LUNDJKgUNuhWXOCbJ5mItZ3MUgHKFGNoxNMV4BJ4Tp0RlbfG7RpQBHvlOHqcn 98b2+ImNX5DOBtnHkUg5Wv6WtEUe38YreAezjzJvtTft1vIh1NdI42B+IIDIfqV2RVoI iqk/dQoBlW4WefrFuDU42brlYuI+WNciUabgsm+YqnkeN9gu56yIx5BgR8yPSAYhlBLF XriDDs4aJgT1tpbZ322MMcKeY4uZJKL9hh1hIY2svYyNjOuSt02mvm0mkNCq8CUIIa87 wqfggSuoyD7WDaHbSyRE9z78KE6HxvtM8s6TBAvHVXWW/nobWKDI0MRCEi+lbUYV1kg4 8mgw==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772562031; x=1773166831; 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=6/SNFrry+1SrlPUExw2mVOKpcPc+tEF53jGskDGRFQs=; b=ii0xLaIge+f8+DpsbMmussGuTtHxgiKRJXw5kyv5e1wIS5zmeHUVTYHGJdBriu5QkV O/QtH3N2Vythgl5u+RNnfRWl7T9ErjdXhQy3zdvQ142hYt68FiizqHbRUhXjHYdPTJ0d j0dqpAVMzkt3xYv+Bly3FuKXeSTLwEECAKHWouJrP3XV3MMX5rpRpMLTE/Yt/UK8xYC4 RZf5WQH08GTh02Y2xG/14kHO6Z8OcjRH4icE3DhZ8TEyAJi4lqsAGQ/ihjhD1ioyAbm5 j/atCb214CR0VXb984WbnaJav50/eNmLEMe2ZpKnWfyBhQG+RXg6mDIxa64HcZ+XYBg3 EEbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772562031; x=1773166831; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=6/SNFrry+1SrlPUExw2mVOKpcPc+tEF53jGskDGRFQs=; b=jCUDEqi9yyR6kBsQL/qtpTEl9sLMuBX9WAvU8hfe1EkLVqYeCtMF0tz+klKfqOjgfP kIrdQJvmG+DJdVzb1xFRzOTAeZ1uey30Cj1yLHILGF3mwYJsOrzOlLb0RC3l+86PtIPJ UMABOan6dupEOVNEtouq1ftVOUQq6rPnK/SKdPrBeNqlAGOyjKmwGG7UzBxQmvZk9hge JwBWiLjzpCwRNVw+WbCYwPzLW7MWu53pTU52m+USZOFzxrlhuKWtHGtTNmqTr6riBSkm GP+w5ewhj9titholrmjfnVhGpmnIGtFwMEkxeg47RwaTvFtrqH6+NCW9yv4304ZGIhxS bgxg== X-Forwarded-Encrypted: i=1; AJvYcCU3+DzWexVO6hQCsrNMVydrslrndeKISGOqNg1K9PwWgA2LYNEMtA+HNFkcJ1Yu1EAyDJ6floX26MxqoLkb@postgresql.org X-Gm-Message-State: AOJu0Ywz7bMkhEOZ/7Yw1kHP4hW5W6ojQBhOLaFKOJVIsou6qER8tJuH zYTuuxh4L25MmZv/JwRGPGL2Rb3n4J7SyLiVGAea7MEO/QA+k1htlWeeV0KxKLudM1OoLKgIFWn VAg/5JWB5E1ObZ1Z9oNU3maZpu4K22wc= X-Gm-Gg: ATEYQzyyVlilT45GI3KH4bQM9YF92Dd9usX/cy+f9bH7Qr7Kktx60OjnjaxZz8CAu9R 1qzp/pynpWJ/GyQTrS3zVyO3iVl4QIbCyVcW2E27iN+u9NQnATVj7Kp8gLVvPLWRWSC+FseNfJC wiCV59zbf0E+6ho0lnI+dEbijCf4ASUoRN2Frvk55qW+DHXHDB5bhZnQ4MT/4iROfmhMHV+AqZV knYA0CQII6Hq3wgqHHGz+NIpnQSnBlEAEcMIyw+nfkCQo4JOP2N4yQvyd/vbc1OBLfJ6HrIhMIO snjGYv/D X-Received: by 2002:a2e:a555:0:b0:37a:4bab:ca09 with SMTP id 38308e7fff4ca-389ff111e6emr15052971fa.6.1772562030966; Tue, 03 Mar 2026 10:20:30 -0800 (PST) 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> <7a5df376fffb273430aec9e89f88c31d52dcf295.camel@j-davis.com> <5dfe845221db2e7d38fc7c2a18a4ba5ea29cdfc0.camel@j-davis.com> <60ff024706fe1beab62a89ac07eb6a721856de2e.camel@j-davis.com> In-Reply-To: From: Masahiko Sawada Date: Tue, 3 Mar 2026 10:19:54 -0800 X-Gm-Features: AaiRm52tIzCIN5_Ege40jLB1fcydaYcl7_wmLhpvo5-mK3gsQyQF8-XSC5IQeoU Message-ID: Subject: Re: [19] CREATE SUBSCRIPTION ... SERVER To: Jeff Davis Cc: Shlok Kyal , Ashutosh Bapat , Bharath Rupireddy , 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 Mon, Mar 2, 2026 at 1:34=E2=80=AFPM Jeff Davis wrote= : > > On Thu, 2026-02-26 at 11:12 -0800, Jeff Davis wrote: > > On Wed, 2026-02-04 at 13:53 +0900, Masahiko Sawada wrote: > > > I've reviewed the latest patch set. I understand the motivation > > > behind > > > this proposal and find it useful. > > > > Thank you, that's important feedback. > > Attached v18: > > * rebase > * Changed ForeignServerConnectionString() to use a local variable > rather than a static. It's not very performance-sensitive, so it's OK > to create a memory context for each invocation, which will be deleted. > I'm not aware of an actual problem in the previous code, but it seemed > a bit less safe. > > I plan to commit the main patch (v18-0001) soon, after rechecking some > details (like the postgres_fdw upgrade). I have a few minor comments: + Oid subserver; /* Set if connecting with server */ + Do we want to add BKI_LOOKUP(pg_foreign_data_wrapper) here? --- + +# Copyright (c) 2021-2024, PostgreSQL Global Development Group + Need to update the copyright year. The rest looks good to me. > v18-0002 could use some review > first. Thank you for making this patch. I'll look at this patch too. FYI interestingly, dblink_fdw can also be used for subscription connections like postgres_fdw. It made me think that it might be interesting to implement a FDW that supports only the libpq connection (i.e., NO HANDLER, NO VALIDATOR, and CONNECTION) as it provides the connection management capability useful for subscriptions while users can avoid any security risks in postgres_fdw that users might be concerned about. Regards, -- Masahiko Sawada Amazon Web Services: https://aws.amazon.com