Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hfUIY-0000j8-Ie for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Jun 2019 19:06:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hfUIX-0004Sf-6l for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Jun 2019 19:06:37 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1hfUIW-0004Rr-T0 for pgsql-hackers@lists.postgresql.org; Mon, 24 Jun 2019 19:06:36 +0000 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hfUIT-0005ZT-G5 for pgsql-hackers@postgresql.org; Mon, 24 Jun 2019 19:06:36 +0000 Received: by mail-qk1-x742.google.com with SMTP id g18so10642433qkl.3 for ; Mon, 24 Jun 2019 12:06:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=zZpCsHKv5RaBH337HxVwlkATWpHGMYWug0MorMcOXok=; b=kk0nga8NLFzHYXkcbBLUalGff13bSG0lhivzUn6+n3JZWibiXCb2cct0LnvUdy/EYU wOcK0NpmMMgrIK3PgJO8zfrZNt7Yzf8vNk8noZhh7rd0HZZCaUSENoB+Rg/RBKJfpkIF dE2dMKF7eVZlaT1uvoW1SYwnCR6ZZINNXiBLGehzgQy+F8VGAeGfxoeyLxQgxSJ+edQu thCfw0GytQuZprbYdQhsGWFLv+G5UxPI4RZyK+mDTb3in6D2lLF8ySPcCLXleN3xjvkq m6ZS9BiH36MDoHogaDoduZYUmAL5GczPdJ2M4mr/di8cqU8ObVNryWEZySQZMNjD0ZEG 3QlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=zZpCsHKv5RaBH337HxVwlkATWpHGMYWug0MorMcOXok=; b=SyWk4S5wH6gLhxffO3N++RpItBL7Wymh9GF2x1I4ra3cDFs2vgQyoNKJa7ha7cAf/V SOakmLNwbu6jpnk9yfbwssfPe+oaj7hrVOJgQPooN9eWzwXjkcMVMeVBjDltEyhnIXgw FOwR7ZX2SeRHabKtXwkcTX0NXcKmXG5OEPorw71uFra6KjcyoYTTmP5hwejx2+xfBQ12 gVeY84Ph64MT5lkoTAz9go2D/g/2hbiUO34769tI5ZpHIKTfaDzDmw7VzITkzWQdn8te YkhFoQ+y+/L3Ok+o3nUPrxXxMv+88zQ1iMz00aNO7raQB9g/767qNNvJdm+j4FMQEBrA sWuQ== X-Gm-Message-State: APjAAAV+Try+fxcmiCM0U4Neuw4NLgrZpB1tYj2G8yhD1ASLjfqbmVI6 bKaFuA/DBOZVd6F6vDTQfgSxZA== X-Google-Smtp-Source: APXvYqxNzK4O1+eTmZz2TDRRxLhCiaOrTccuZ7H2HT/VKF4+ASAWvMQBcI9Fygmm8iP7ueec7N/yOQ== X-Received: by 2002:a37:a80d:: with SMTP id r13mr27606970qke.209.1561403191868; Mon, 24 Jun 2019 12:06:31 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id m5sm5853271qke.25.2019.06.24.12.06.31 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 12:06:31 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 5B1791208DB; Mon, 24 Jun 2019 15:06:25 -0400 (-04) Date: Mon, 24 Jun 2019 15:06:25 -0400 From: Alvaro Herrera To: Robert Haas Cc: Stephen Frost , Amit Kapila , Ian Barwick , "pgsql-hackers@postgresql.org" Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions Message-ID: <20190624190625.GA10524@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Jun-24, Robert Haas wrote: > On Sat, Jun 22, 2019 at 5:13 PM Stephen Frost wrote: > > All that said, whatever code it is that we write for pg_basebackup to do this properly should go into our client side library, so other tools can leverage that and avoid having to write it themselves. > > That is probably only going to help people who are writing in C (or > maybe some close family member) and a lot of tools for managing > PostgreSQL will be written in scripting languages. But we already have ALTER SYSTEM, so why do we need to write it again? You just need to check whether the system is running: if it is, connect and do "ALTER SYSTEM". If it isn't, do `echo ALTER SYSTEM | postgres --single`. Maybe we can embed smarts to do that in, say, pg_ctl; then everybody has access to it. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services