Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHIap-0001Qy-G8 for pgsql-committers@arkaria.postgresql.org; Wed, 03 Mar 2021 03:54:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lHIao-0006NR-0e for pgsql-committers@arkaria.postgresql.org; Wed, 03 Mar 2021 03:54:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHIan-0006NK-AY for pgsql-committers@lists.postgresql.org; Wed, 03 Mar 2021 03:54:33 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHIai-00085r-UW for pgsql-committers@lists.postgresql.org; Wed, 03 Mar 2021 03:54:32 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id EEC1D5C011B; Tue, 2 Mar 2021 22:54:26 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 02 Mar 2021 22:54:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=XLhiWjrP/9eTzsDPjTLU55XO7XK +PdQlSqB6UoS3CXY=; b=qPUsdQRh7gAfx3ir0w+3KJWyVBCFTZ44L4S0js8a8gy mghvTnPqja9orXRNpy7Oz2ZM6yUSBK5nzuZaTmE7bIqLLE7gBwjdELRLCh0pR2bj nPuiIFd41oiKadZ8U5+SwihC6J9Upvw8SnyXCn6I980Qtc413RZmUcgfcyeUAZDR rUTScWmQf4pRfE79df0ztZOQRiio1o98GVYadRu3+KI2fxAS6+U7FimXE1V3tSig ASr4oGJxSqtwUkCS1nX5x6tFj4trutI/rt/u55W7fw0cg3mRpqgI+lMnW/lUc+cV WJFN/tpJ+UxnmP2dvUpgGtMn/6MdsWKLRVV8LzgMq2A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=XLhiWj rP/9eTzsDPjTLU55XO7XK+PdQlSqB6UoS3CXY=; b=pWSCJeyjOPWyLBdz2TOUtV o+OwVUYzpkGz+JQkMZ95Nx5JRYAuuF+u0/uPbmTm9D/YG0iaDpYfloYTG3K3cU0K sh6Hhm53kStmuKDzNwehp5721RLexnI/BjLmKlT7rE7xqTR/IZYP1NScX4mf11Ow HYbsFgnbf7iRCnMBh/qwPas+7LC922y++pJEQNoudWVJE5bEjeg9uVSp+1jWP2Nv EmTuP/yswPO1KReQeYGULKrJUTt+YqO6XcfQljMzE2xDWwOWoqrDKPfEz70MbKuv XKzYCrSQSNp913RjNMMF7B+DB5eiHjVYDGKWxM/BfoWleyzRx5nPioeH58lrgP7w == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddtuddgheelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpeffhf fvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhu ihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrh hnpedvgeduuefhtdeuleettdevjeehheeiveeuieegleetgeeljeelieeuieehgeevhfen ucfkphepudduuddruddtvddrudektddrudekheenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 377641080054; Tue, 2 Mar 2021 22:54:24 -0500 (EST) Date: Wed, 3 Mar 2021 12:54:15 +0900 From: Michael Paquier To: Tom Lane Cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Extend the abilities of libpq's target_session_attrs parameter. Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ORmfyJkqr+DUw+d1" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --ORmfyJkqr+DUw+d1 Content-Type: multipart/mixed; boundary="wLfRM6MkChQNQdjO" Content-Disposition: inline --wLfRM6MkChQNQdjO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 03, 2021 at 01:17:57AM +0000, Tom Lane wrote: > Extend the abilities of libpq's target_session_attrs parameter. >=20 > In addition to the existing options of "any" and "read-write", we > now support "read-only", "primary", "standby", and "prefer-standby". > "read-write" retains its previous meaning of "transactions are > read-write by default", and "read-only" inverts that. The other > three modes test specifically for hot-standby status, which is not > quite the same thing. (Setting default_transaction_read_only on > a primary server renders it read-only to this logic, but not a > standby.) pgperlcritic is complaining after this commit: =2E/src/test/recovery/t/001_stream_rep.pl: Variable declared in conditional statement at line 88, column 2. Declare variables outside of the condition. ([Variables::ProhibitConditionalDeclarations] Severity: 5) perlcritic is picky on this one, but you could just separate that stuff into two lines like in the attached. -- Michael --wLfRM6MkChQNQdjO Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="recovery-perlcritic.patch" Content-Transfer-Encoding: quoted-printable diff --git a/src/test/recovery/t/001_stream_rep.pl b/src/test/recovery/t/00= 1_stream_rep.pl index 07a9912ce2..684bc8adbd 100644 --- a/src/test/recovery/t/001_stream_rep.pl +++ b/src/test/recovery/t/001_stream_rep.pl @@ -85,7 +85,8 @@ sub test_target_session_attrs my $node2_port =3D $node2->port; my $node2_name =3D $node2->name; =20 - my $target_name =3D $target_node->name if (defined $target_node); + my $target_name =3D undef; + $target_name =3D $target_node->name if defined($target_node); =20 # Build connection string for connection attempt. my $connstr =3D "host=3D$node1_host,$node2_host "; --wLfRM6MkChQNQdjO-- --ORmfyJkqr+DUw+d1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmA/CGcACgkQnvQgOdby QH26mQ//RPzJHANBVzgEC29qnOmum9E8poFS4mMgUdKvXLEFGF3ej2q01+c/2CED 8YbtojIH51j0jgvzrNDJx5W1ExgjiUwFzAznHziihrafdZPHoJ90Z5733V6rdAjC LMbzn1pfdOrDHAMqlGdgzv46y3HmQTKt497tkXDZdrX1D1hlu5OJYMsimveGr5yM 9MSvQ7B+xUbpc0Cmp+r9g7sf7i/1KmmlVJ17ykKSji6tvjmhp3VHhUhzMtx1KH8e PZ0COA/7cmLpyz+E3HhlUwtEj4H7mwxewWcELMII/nCu9/nOnThBYAChNj1NUr01 Fw+FHKX9O4F82md2MZtKtu1ek69992H9m5jWQURFYTHh1wF8EosQLbx3Q2qAmYh5 UnHvn901V+WR5eavDhUTZZLSJjue79rgZP8R2QOe7ttJQOdyF8Cor/mB+Yjh3Olx QC1Dok2FMkIOXnLETb5/C41ARkEIfTBNDz5pteJJcU72pyEGdI9nT/05/OcOuEyS gkn5Egctm+xnrjlF1MyOuuJiNEmJFab2LZEzh4eee6Ow9g8+fPgIaAK1vTV+bGCM JoFZ1YgEBBslhEWmHN5nBSIW5z2ZnJPxDmvHWSRZaFb8qsEqOBXfa51l9NhwnU30 d5e9RZogyvY0VTtAv0U5zsX8Z2qgb0/dssOTokpfcg6pTQDAOJw= =OcfN -----END PGP SIGNATURE----- --ORmfyJkqr+DUw+d1--