Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bpHsS-0002dq-Ov for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Sep 2016 16:38:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bpHsS-0006eN-Ba for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Sep 2016 16:38:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bpHsQ-0006bA-JB for pgsql-hackers@postgresql.org; Wed, 28 Sep 2016 16:38:34 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bpHsN-0005gK-70 for pgsql-hackers@postgresql.org; Wed, 28 Sep 2016 16:38:34 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id B7E1C2048F; Wed, 28 Sep 2016 12:38:29 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Wed, 28 Sep 2016 12:38:29 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=NE8I+mYOoxRDX6U 6scyg+FYNC50=; b=bcomG6Dd4bLY/u5EzyDlm6duSDTH6xaEOPG0yb4V5zU/5Zp lQJeYYh+VzEh03cFk//u5nPmlFuBvOwBaiUA09raQ/uIWGrTcGcSyyVpb3UWDDe3 IPEYj1RfrDntOuisxIl+hMXwphGFQ+ZuiXsG0cE1JMJsZJPbz5X3phc7xTNs= X-Sasl-enc: xMTGjkWodlEErsQIJATp8TkIJ3FljaDCu3eU4vyH8d9V 1475080709 Received: from april.local (c-73-13-66-39.hsd1.pa.comcast.net [73.13.66.39]) by mail.messagingengine.com (Postfix) with ESMTPA id 6BC37CC087; Wed, 28 Sep 2016 12:38:29 -0400 (EDT) Subject: Re: [COMMITTERS] pgsql: pg_ctl: Detect current standby state from pg_control To: Michael Paquier References: <18364.1474818887@sss.pgh.pa.us> <27012.1474894431@sss.pgh.pa.us> <1b5f8f59-e3b4-b158-ef88-d409b413ec43@2ndquadrant.com> Cc: Tom Lane , pgsql-hackers From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: Date: Wed, 28 Sep 2016 12:38:28 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 9/28/16 12:44 AM, Michael Paquier wrote: > On Tue, Sep 27, 2016 at 9:55 AM, Michael Paquier > wrote: >> > Seems overcomplicated to me. How about returning the control file all >> > the time and let the caller pfree the result? You could then use >> > crc_ok in pg_ctl.c's get_control_dbstate() to do the decision-making. > In short I would just go with the attached and call it a day. Pushed that way. Thanks! -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers