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 1rUVdv-00BLwG-Em for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Jan 2024 17:42:00 +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 1rUVdu-00GAOs-K0 for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Jan 2024 17:41:58 +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 1rUVdu-00GAOk-A0 for pgsql-hackers@lists.postgresql.org; Mon, 29 Jan 2024 17:41:58 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rUVdr-0040Ma-Nn for pgsql-hackers@postgresql.org; Mon, 29 Jan 2024 17:41:57 +0000 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-51109060d6aso2312071e87.2 for ; Mon, 29 Jan 2024 09:41:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706550114; x=1707154914; 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=bLdKdZeB7uZaFZtPxuY0+aLIl4ek49eGzi1yD+bURMw=; b=mqVCB9wsSHsg77Ch54YjOz47Y9CuKmiz+8frXxhdvswozq2Vx2w1oWDLRdMyJwtgL1 eMpCC5eSMnU9bLCd9VFLiIXHV7bAfqiTRH/BzYwWgGJgNTCzcMKV6RFi6gv9EyAzr38+ Pd2sBGOnmYC9aPFKlH38Bt4OQ5J8P7U3meToIcfmT8US7aFOxxeMbLAFqA7icCojMTHD Aemq0lx3ORGwvrE5qt5ZmLAfpY01GS3RNIxHeT/ilQfWq7pC8eKnIhBaV40UkEBjyt2d elDnPW6cFlIfdEc8yMjEPlOcp7qk/W8IP+SKcmIX2gHcXOiKS+SJLfdCzgnZDlswkK05 ZVyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706550114; x=1707154914; 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=bLdKdZeB7uZaFZtPxuY0+aLIl4ek49eGzi1yD+bURMw=; b=JQCcWcbckl2Q/gsA88bOTugnyK3Aagp19j5B6WVczOLN1FuIUgelfW60RgjOAZ1tSk On4Qh5tgfVhy9q1QwvsZcnV66MgrlKsO/VZkVcbH/V2kHa/fmXZTUwDxc0+c/pVlnSkt aSO4qrEAGoVH636+q1OBpw92xYLCSKzcdXWIMNnriaH9uJ57BEZ6I5JcCLvdShlfeAHR 0+4Vx+Lox3lRDPDTNWf/MFGtTup72yxgq+9Oa74DPeN+JXulD4Va0ZRNz+1S2GYKjawL CTwPuPfrssFUGwrGdRZhlyPDIwJHX/Ir4Lcn6o63T7kKr/J4OOApqqmdjT4SIBifAEhK IHNQ== X-Gm-Message-State: AOJu0YydJARWByNwkdDuCLkwfGW/QwMW5m4cPr0HswapUx2LpEV4MCzY G5HwL53ki0Ord9XVTDmuY6jFY3gOIod78rtfeNskL4Z8z73eSDhsyWpsaoAmKMZxgd+ajoa9QaG fiQhhMZfJoNNlb0kMbYxWZ7n/hyFR1tPr7QM= X-Google-Smtp-Source: AGHT+IHAA9amZ8Mmh6EzUOjCnieCURrk+6xSvyM4ZXTYZ5wApgx9WyZhWY0NFLzfL+6u+60HkmddlxsE2wWAruo4r2w= X-Received: by 2002:a05:651c:1212:b0:2cf:2499:b94a with SMTP id i18-20020a05651c121200b002cf2499b94amr5369640lja.43.1706550113430; Mon, 29 Jan 2024 09:41:53 -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> In-Reply-To: <7338f22c4534322a08ab6ce9f879e2e308eb5e5d.camel@j-davis.com> From: Bharath Rupireddy Date: Mon, 29 Jan 2024 23:11:41 +0530 Message-ID: Subject: Re: [17] CREATE SUBSCRIPTION ... SERVER To: Jeff Davis Cc: Ashutosh Bapat , 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 Wed, Jan 24, 2024 at 7:15=E2=80=AFAM Jeff Davis wrot= e: > > On Tue, 2024-01-23 at 15:21 +0530, Ashutosh Bapat wrote: > > I am with the prefix. The changes it causes make review difficult. If > > you can separate those changes into a patch that will help. > > I ended up just removing the dummy FDW. Real users are likely to want > to use postgres_fdw, and if not, it's easy enough to issue a CREATE > FOREIGN DATA WRAPPER. Or I can bring it back if desired. > > Updated patch set (patches are renumbered): > > * removed dummy FDW and test churn > * made a new pg_connection_validator function which leaves > postgresql_fdw_validator in place. (I didn't document the new function > -- should I?) > * included your tests improvements > * removed dependency from the subscription to the user mapping -- we > don't depend on the user mapping for foreign tables, so we shouldn't > depend on them here. Of course a change to a user mapping still > invalidates the subscription worker and it will restart. > * general cleanup > > Overall it's simpler and hopefully easier to review. The patch to > introduce the pg_create_connection role could use some more discussion, > but I believe 0001 and 0002 are nearly ready. Thanks for the patches. I have some comments on v9-0001: 1. +SELECT pg_conninfo_from_server('testserver1', CURRENT_USER, false); + pg_conninfo_from_server +----------------------------------- + user =3D 'value' password =3D 'value' Isn't this function an unsafe one as it shows the password? I don't see its access being revoked from the public. If it seems important for one to understand how the server forms a connection string by gathering bits and pieces from foreign server and user mapping, why can't it look for the password in the result string and mask it before returning it as output? 2. + */ +typedef const struct ConnectionOption *(*walrcv_conninfo_options_fn) (void= ); + struct here is unnecessary as the structure definition of ConnectionOption is typedef-ed already. 3. + OPTIONS (user 'publicuser', password $pwd$'\"$# secret'$pwd$); Is pwd here present working directory name? If yes, isn't it going to be different on BF animals making test output unstable? 4. -struct ConnectionOption +struct TestConnectionOption { How about say PgFdwConnectionOption instead of TestConnectionOption? 5. Comment #4 makes me think - why not get rid of postgresql_fdw_validator altogether and use pg_connection_validator instead for testing purposes? The tests don't complain much, see the patch Remove-deprecated-postgresql_fdw_validator.diff created on top of v9-0001. I'll continue to review the other patches. -- Bharath Rupireddy PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com