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 1mkxtm-0000Nh-52 for pgsql-general@arkaria.postgresql.org; Thu, 11 Nov 2021 00:25:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mkxtl-0003Q0-2D for pgsql-general@arkaria.postgresql.org; Thu, 11 Nov 2021 00:25:01 +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 1mkxtk-0003Pr-NC for pgsql-general@lists.postgresql.org; Thu, 11 Nov 2021 00:25:00 +0000 Received: from crocodile.elm.relay.mailchannels.net ([23.83.212.45]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mkxtd-0001PA-3F for pgsql-general@postgresql.org; Thu, 11 Nov 2021 00:24:59 +0000 X-Sender-Id: a2hosting|x-authuser|bench@silentmedia.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id A23A58814C2; Thu, 11 Nov 2021 00:24:49 +0000 (UTC) Received: from a2ss24.a2hosting.com (unknown [127.0.0.6]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id E18A58814D0; Thu, 11 Nov 2021 00:24:48 +0000 (UTC) X-Sender-Id: a2hosting|x-authuser|bench@silentmedia.com Received: from a2ss24.a2hosting.com (a2ss24.a2hosting.com [75.98.175.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.105.57.78 (trex/6.4.3); Thu, 11 Nov 2021 00:24:49 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: a2hosting|x-authuser|bench@silentmedia.com X-MailChannels-Auth-Id: a2hosting X-Cure-Occur: 5ed9341b35b1297d_1636590289508_1456631415 X-MC-Loop-Signature: 1636590289508:338622149 X-MC-Ingress-Time: 1636590289508 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=silentmedia.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8W7nB0XA+ci7OdO/xtq+3BdDWCoHViLDd2RnYmRW2ko=; b=KW5CSSYOLlV8pnai+6U1jYyRrz aW7AS7bUCaCW7lGqILfFpgXN63U/IOTxLOIZ3kugSW26B/c8b3Q1k9Ub7mbbQtHQ47YSTRPp53j1l VPlZl+Fq0orhbLtDhRrwonnBekdPV3yKqY0j2XXREXI1SuVTz9h+8Gc/tgqv3fXwCCPYOz+LXCOY2 JirsjhN+YuNj6mLxgUxm40Bla397HSJvFIxfy0arGFWgYWwM7oJDnvPPB9oNEF5aoihr2qS1UI9PN /7AZJLkUhVH6slI38ZQ+TZOq5bWxZrCPs82KRzeZVpgwPqVaQo67vuaacipnQEIpkKX5BgqTVAJLp BAdUjC6Q==; Received: from 97-113-88-109.tukw.qwest.net ([97.113.88.109]:52623 helo=Rolo.local) by a2ss24.a2hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1mkxtX-0007sk-IC; Wed, 10 Nov 2021 19:24:47 -0500 Subject: Re: Pause streaming replication To: Rita Cc: "pgsql-general@postgresql.org >> PG-General Mailing List" References: From: Ben Chobot Message-ID: <476bcc51-c1e4-1fb1-24c6-07cd5f6d5d80@silentmedia.com> Date: Wed, 10 Nov 2021 16:24:45 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:52.0) Gecko/20100101 PostboxApp/7.0.51 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-AuthUser: bench@silentmedia.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Rita wrote on 11/10/21 1:25 PM: > Hello. > > I am testing alerting on my primary and standby setup. I have async > replication working but I would like to temporarily pause it so the > value of 'state' isn't streaming. (select * from pg_stat_replication). > > How can I do that? By reading the fine manual: https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-RECOVERY-CONTROL-TABLE The function you are looking for is pg_wal_replay_pause().