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 1kg3Gz-00040X-5K for pgsql-general@arkaria.postgresql.org; Fri, 20 Nov 2020 10:04:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kg3Gx-0004Au-QH for pgsql-general@arkaria.postgresql.org; Fri, 20 Nov 2020 10:04:07 +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 1kg3Gx-0004An-Il for pgsql-general@lists.postgresql.org; Fri, 20 Nov 2020 10:04:07 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kg3Gv-0003GY-Nk for pgsql-general@lists.postgresql.org; Fri, 20 Nov 2020 10:04:07 +0000 Received: by mail-wr1-x433.google.com with SMTP id p1so9362285wrf.12 for ; Fri, 20 Nov 2020 02:04:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=7k2+8LRtqUM3IjnjKIlX2NmWaYqzs362oOY6zuksgYw=; b=uJ2LStmCDrNgujq9aswsngAHQfdkth3BvDCTxkw7mFixaBMN4HOA74FCr2ufzuHeIX mvSeyifCQDjULR1+0AeFUQh9JuHAEWM9fZJwQMB45V8bEbBaR4d9dW98219SBWFOcH6i ztJSrXeT6+DvenDgkYPcxG0wZjwvINlqd8oikyzFQ8zcTekYjmyV0KpdrnK/UhLN3qZ1 OvJrkbw9HQlPox2zugj1fzP/c1CI1K3rEzeQbWCmi9xaE0rYPo7HtGjtwPMsDV+U3WMa dWgUvHUrY/BdYy9Zs70CcVplGKFVYtxTz7zmkjcFlhVSB0JvmeJIweCiYuAYXU+jlcr1 2mIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=7k2+8LRtqUM3IjnjKIlX2NmWaYqzs362oOY6zuksgYw=; b=GIKCIaOgp2FP528+Ycg6pgSEyWWoclp+w8W3NIF6sRya5oRj/NCpt/2eL3qN62peQc ZJUczizr6wjuphVgMpO5ZUjQa5LwCHIh2Mr+Ls5v6UHSlKVSTn+mi6bxBEc7LypZcEt+ dRkk5QOXYkpcjSOlbfB251YXurYk4+a5NAJzMQEVrEvhcvb+MJFOqoYtpI6PxYCMQfQu PG4fgtvi73doSvhfdh3+vpVYBvVaWvKL4JL0x3dnqZli507ECvtAJsplESO5LY4SBI3r H6nCj4aHBxt0qcLVAZCD84IFRjCMbVg+sJ6RTCgbb5SxxLglC7D1VlIlZTlBrdLpTyBP HLSA== X-Gm-Message-State: AOAM5301rB6RzXFVBIIff3P7GmxUHU67SQ5uZ4/Rqmf7a8ho9ZO2t5Ej j0M/6P7+qWNc07f9UXDu/90= X-Google-Smtp-Source: ABdhPJzfMOe1ipRJKIN1+Y8nXQk2Sqz0e0U12Dz+c78MjacZhbC0AR0svtWGHBAKpuYHVcOdDVbxgA== X-Received: by 2002:a5d:614e:: with SMTP id y14mr16041356wrt.25.1605866644992; Fri, 20 Nov 2020 02:04:04 -0800 (PST) Received: from [192.168.1.8] (241-57-239-77.dyn.cable.fcom.ch. [77.239.57.241]) by smtp.gmail.com with ESMTPSA id a144sm3957267wmd.47.2020.11.20.02.04.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Nov 2020 02:04:04 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.20.0.2.21\)) Subject: Re: Determine if postgresql cluster running is primary or not From: =?utf-8?Q?Paul_F=C3=B6rster?= In-Reply-To: Date: Fri, 20 Nov 2020 11:04:03 +0100 Cc: Thomas Kellerer , pgsql-general Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Raul Kaubi X-Mailer: Apple Mail (2.3654.20.0.2.21) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi Raul, > On 20. Nov, 2020, at 10:41, Raul Kaubi wrote: >=20 > Hi >=20 > Thanks. > Seems like 9.5 does not work. >=20 > ERROR: relation "pg_stat_wal_receiver" does not exist > LINE 20: from pg_stat_wal_receiver >=20 > Any ide how to achieve this in 9.5 ? >=20 > Raul this query is tested to work on 10.x and newer, not 9.x. I don't have = 9.x, so I can't say, sorry. Cheers, Paul=