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 1rLfD3-009KpU-H7 for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Jan 2024 08:05:41 +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 1rLfC1-001SiS-IQ for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Jan 2024 08:04:37 +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 1rLfC1-001ShT-3l for pgsql-hackers@lists.postgresql.org; Fri, 05 Jan 2024 08:04:37 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rLfBu-00DpEO-3a for pgsql-hackers@postgresql.org; Fri, 05 Jan 2024 08:04:35 +0000 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1d4d5b37670so8993125ad.0 for ; Fri, 05 Jan 2024 00:04:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1704441869; x=1705046669; 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=/5eG3UWNCRxaNbmi+m2Uilwyeq+rejsof4eUW1G0r3c=; b=IaW6DsExvfSNQU4JGAvE/Ap2nD9WPiG8JhT26QX8U/so2WBr/RmyEbE0KAzW9QWpAf joM8MYaVtZ263p1zPn1x27nKCll2T2fQcZ9JiyGrp1O7A0tFwxrYrQS0v+fgscmKAgJr wA44mHo873tsuQkTYyvmjtCIIDviXhhs9miR+UBPuiu8QhI+aEK8u8Szn+acnW3kcuVc j4f2cw2tdy468dpQCpQvYDUQ5djhWq6b86kANWVUwpFkz24+MURQnu6eMyyBxCam2yqV LqKnCxDbxvqsasvDVSn6K2FDaqBqx20/Lm7RzpWGCEwr5/Mlq69DpP+2Kec/dxXXUCvV 04vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704441869; x=1705046669; 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=/5eG3UWNCRxaNbmi+m2Uilwyeq+rejsof4eUW1G0r3c=; b=u5QnhqzKr9FB3zbk+sQEkK0rW+4r5KBw4Ssb6rEpsYdVT9QmEiGQJeUE7ARqTcLv1M RlvQuxJgvMUIIlR6Y0djss617E11NI2CsGvweftHO5NQyhrXKx+XXp4ZHOiN10Rpgxnm xBDSfLizoeuGOFjR0885iVUu1I+AJ08GgDeRLJDyX1ArBeIiXFhCffDMOO7CBJzv2Uvj Q43QhutLfjIIjYUbE8HBW2yJ2wO+by83qJo1yeDHFLgftTPSpMiKsr8h3vdOiETitLgf 8oZsFT4tZ0FPDTdVNqF25L5c21bZqz4Sb93WqeHzBkkzhnnI6nWYE4kG4bHAu4949KhZ Aq0g== X-Gm-Message-State: AOJu0YynT7ZahH0+S5yNAlFsR013iQimfGwj/rnHkN1QlBF+2HVIYlQc HOa2V0W+LQMRrC0TosOf78bbUBmW6854 X-Google-Smtp-Source: AGHT+IGZ4fK3NvZLSvA7yGiqSHHMykE9ROcFLzgoqYmNCXUqaJxzTSTd4ZwW37aLb6J0KWTJnBxvaQ== X-Received: by 2002:a17:902:7c91:b0:1d3:ec57:162c with SMTP id y17-20020a1709027c9100b001d3ec57162cmr1400642pll.73.1704441868856; Fri, 05 Jan 2024 00:04:28 -0800 (PST) Received: from jeff-laptop.lan (c-76-102-242-158.hsd1.ca.comcast.net. [76.102.242.158]) by smtp.gmail.com with ESMTPSA id g14-20020a1709029f8e00b001d3f68db03fsm809969plq.153.2024.01.05.00.04.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 00:04:28 -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: Fri, 05 Jan 2024 00:04:26 -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> 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 Fri, 2024-01-05 at 12:49 +0530, Ashutosh Bapat wrote: > Can you please provide an example using postgres_fdw to create a > subscription using this patch. I think we should document it in > postgres_fdw and add a test for the same. There's a basic test for postgres_fdw in patch 0003, just testing the syntax and validation. A manual end-to-end test is pretty straightforward: -- on publisher create table foo(i int primary key); create publication pub1 for table foo; insert into foo values(42); -- on subscriber create extension postgres_fdw; create table foo(i int primary key); create server server1 foreign data wrapper postgres_fdw options (host '/tmp', port '5432', dbname 'postgres'); create user mapping for u1 server server1 options (user 'u1'); select pg_conninfo_from_server('server1','u1',true); create subscription sub1 server server1 publication pub1; I don't think we need to add an end-to-end test for each FDW, because it's just using the assembled connection string. To see if it's assembling the connection string properly, we can unit test with pg_conninfo_from_server(). Regards, Jeff Davis