pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Extend the abilities of libpq's target_session_attrs parameter.
Date: Wed, 3 Mar 2021 12:54:15 +0900
Message-ID: <YD8IZ9OKfUf9X1eF@paquier.xyz> (raw)
In-Reply-To: <E1lHG9F-0001UG-Lz@gemulon.postgresql.org>
References: <E1lHG9F-0001UG-Lz@gemulon.postgresql.org>

On Wed, Mar 03, 2021 at 01:17:57AM +0000, Tom Lane wrote:
> Extend the abilities of libpq's target_session_attrs parameter.
> 
> 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:
./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

Attachments:

recovery-perlcritic.patch (text/x-diff, 588B) download diff --git a/src/test/recovery/t/001_stream_rep.pl b/src/test/recovery/t/001_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 = $node2->port; my $node2_name = $node2->name; - my $target_name = $target_node->name if (defined $target_node); + my $target_name = undef; + $target_name = $target_node->name if defined($target_node); # Build connection string for connection attempt. my $connstr = "host=$node1_host,$node2_host ";
signature.asc (application/pgp-signature, 832B) download

view thread (3+ messages)  latest in thread

Message-ID: <YD8IZ9OKfUf9X1eF@paquier.xyz>
Permalink:  ../YD8IZ9OKfUf9X1eF@paquier.xyz/
Also on:    postgresql.org/message-id/YD8IZ9OKfUf9X1eF@paquier.xyz

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Extend the abilities of libpq's target_session_attrs parameter.
  In-Reply-To: <YD8IZ9OKfUf9X1eF@paquier.xyz>
  References: <E1lHG9F-0001UG-Lz@gemulon.postgresql.org> <YD8IZ9OKfUf9X1eF@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox