Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b9C80-00084G-PJ for pgsql-general@arkaria.postgresql.org; Sat, 04 Jun 2016 14:00:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1b9C80-0002Rx-3M for pgsql-general@arkaria.postgresql.org; Sat, 04 Jun 2016 14:00:40 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b9C5g-0007Jb-4j for pgsql-general@postgresql.org; Sat, 04 Jun 2016 13:58:16 +0000 Received: from fr1.2ndquadrant.fr ([2001:41d0:2:127c::1]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b9C5Y-0005Np-Dp for pgsql-general@postgresql.org; Sat, 04 Jun 2016 13:58:14 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by fr1.2ndquadrant.fr (Postfix) with ESMTP id 6320060DA6; Sat, 4 Jun 2016 15:58:05 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at fr1.2ndquadrant.fr Received: from fr1.2ndquadrant.fr ([127.0.0.1]) by localhost (fr1.2ndquadrant.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vrhEd___8W6z; Sat, 4 Jun 2016 15:58:04 +0200 (CEST) Received: from [192.168.0.3] (ath91-3-88-167-161-184.fbx.proxad.net [88.167.161.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: charles) by fr1.2ndquadrant.fr (Postfix) with ESMTPSA id C38AE5FE04; Sat, 4 Jun 2016 15:58:03 +0200 (CEST) Subject: Re: Replication To: Bertrand Paquet , pgsql-general@postgresql.org References: From: Vik Fearing Message-ID: <5752DE6A.7010706@2ndquadrant.fr> Date: Sat, 4 Jun 2016 15:58:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -3.3 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org On 02/06/16 15:32, Bertrand Paquet wrote: > Hi, > > On an hot standby streaming server, is there any way to know, in SQL, to > know the ip of current master ? No. > The solution I have is to read the recovery.conf file to find > primary_conninfo, That is currently the only solution. There are plans to allow SQL access to the parameters in recovery.conf (or to merge them into postgresql.conf) but that's not currently possible. > but, it can be false. It would only be wrong if recovery.conf has been edited since the stanby was last restarted. There are hooks for connections and disconnections of the walreceiver, so it should be possible and fairly simple to write an extension that remembers and exposes the primary_conninfo in effect. -- Vik Fearing +33 6 46 75 15 36 http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general