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 1rUuzj-00DnaU-T2 for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Jan 2024 20:46:12 +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 1rUuzj-009Wrr-4C for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Jan 2024 20:46:11 +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 1rUuzi-009WrZ-N0 for pgsql-hackers@lists.postgresql.org; Tue, 30 Jan 2024 20:46:10 +0000 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rUuzd-004D2K-GE for pgsql-hackers@postgresql.org; Tue, 30 Jan 2024 20:46:09 +0000 Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-6dc8b280155so2600777a34.0 for ; Tue, 30 Jan 2024 12:46:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1706647564; x=1707252364; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=5l37jdnerpV/tpL6CQcy/dIS+A5m5QYt/mpgp+aKoGg=; b=EVIo7MevyBs5ciWZ66WXxaCmm3KZ3sURI5QAtU/G+5KWZ11RbcC+3qvqKDYbYNyId/ 2wj7UdvM98JhaDNE8elsluHtmknzM6RmDd25tgONhOClTB+Na43eehciDav6HLmbAvxs 596MV3k1m41bMpBxrBksBEkKzm8fJ+F7vcE5umEjIraoQnJAf+UGKKAql5/L9BRvQANe FdBv3fvbwBXqcJLQ04to+iMHcSQmpN0LUXXxOmmCyoGGrJQDtcBR8h4MUftaMtgSZ3pm e6r9/HX7BbIacr+5uvYQwajLAWZyPnMlT/opiUry0695IPBBIm4wY4cKrm5iWYAB51/3 GaSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706647564; x=1707252364; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=5l37jdnerpV/tpL6CQcy/dIS+A5m5QYt/mpgp+aKoGg=; b=FB8LeDXBzflm5VLnJX3qQq4/A5UEFyeK9sS0WSgyA+FCQeqfdFxFb60oZGDNJiR9Km /1XQXVNz438Yqrb1dcO/l3zGraWPPy6iaI+TPaB4x54EXX2FVVCk3riYPwwpMkmcUqgG a4pwvJI4zcPhDMtytqwStFISOqtJyLi1I/R4aNEO35Uq3o2YDrZIrvGLEJ8cP4rUToCU HrxyRngo2npFzAgoBTti8S2J2HCsue8EP//SuBWBKRy7DSEjj4rAfSKkEpP6kzm0JGWJ cHkbEa+Iy97xBCWrksRT+kgXZ7zMf/9Mcna8JA8QdiJHhWjx1UXrIdG7N3rxAGwR3VRy wSOA== X-Gm-Message-State: AOJu0YxN0XZcJ3kVNPEUyQf7ZUOGUp8zyRiUpbAZMHdksMjw+7tY1g65 ziNy9VVzkeMr29ACWG6NqGzeipbXkTICS1atjEQ+SXp8FCNDBOqmtSPmfGJgSfXc6mruJMkEfK8 = X-Google-Smtp-Source: AGHT+IGNq43DhgLFIbFANNWPBm5msNI5chtlb7a3xpDVnOk3HOl7s6ntMAkJQUyPKxFGKqFMuRtr6A== X-Received: by 2002:a9d:75ce:0:b0:6e0:fd9d:69f0 with SMTP id c14-20020a9d75ce000000b006e0fd9d69f0mr5702658otl.16.1706647564109; Tue, 30 Jan 2024 12:46:04 -0800 (PST) Received: from [172.19.248.17] ([205.220.129.31]) by smtp.gmail.com with ESMTPSA id hg22-20020a05622a611600b0042a9d8efe27sm2838913qtb.96.2024.01.30.12.45.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 12:46:03 -0800 (PST) Message-ID: Subject: Re: [17] CREATE SUBSCRIPTION ... SERVER From: Jeff Davis To: Ashutosh Bapat Cc: Bharath Rupireddy , Joe Conway , pgsql-hackers@postgresql.org Date: Tue, 30 Jan 2024 12:45:39 -0800 In-Reply-To: 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> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2024-01-30 at 16:17 +0530, Ashutosh Bapat wrote: > Converting a server and user mapping to > conninfo should be delegated to the FDW being used since that FDW > knows best how to use those options. If I understand you correctly, you mean that there would be a new optional function associated with an FDW (in addition to the HANDLER and VALIDATOR) like "CONNECTION", which would be able to return the conninfo from a server using that FDW. Is that right? I like the idea -- it further decouples the logic from the core server. I suspect it will make postgres_fdw the primary way (though not the only possible way) to use this feature. There would be little need to create a new builtin FDW to make this work. To get the subscription invalidation right, we'd need to make the (reasonable) assumption that the connection information is based only on the FDW, server, and user mapping. A FDW wouldn't be able to use, for example, some kind of configuration table or GUC to control how the connection string gets created. That's easy enough to solve with documentation. I'll work up a new patch for this. Regards, Jeff Davis