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 1jlauq-0005yp-Qj for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Jun 2020 16:27:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jlaup-0007N7-NM for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Jun 2020 16:27:55 +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 1jlaup-0007N0-Gl for pgsql-hackers@lists.postgresql.org; Wed, 17 Jun 2020 16:27:55 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jlaum-0003vy-3o for pgsql-hackers@postgresql.org; Wed, 17 Jun 2020 16:27:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 05HGRmn91448928; Wed, 17 Jun 2020 12:27:48 -0400 From: Tom Lane To: Robert Haas cc: Amit Kapila , amul sul , PostgreSQL-development Subject: Re: [Patch] ALTER SYSTEM READ ONLY In-reply-to: References: <1445158.1592405895@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Wed, 17 Jun 2020 12:07:22 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1448926.1592411268.1@sss.pgh.pa.us> Date: Wed, 17 Jun 2020 12:27:48 -0400 Message-ID: <1448927.1592411268@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Robert Haas writes: > This seems like pretty dubious hand-waving. Of course, things that > write WAL are going to be broken by a switch that prevents writing > WAL; but if they were not, there would be no purpose in having such a > switch, so that's not really an argument. But you seem to have mixed > in some things that don't require writing WAL, and claimed without > evidence that those would somehow also be broken. Which of the things I mentioned don't require writing WAL? You're right that these are the same things that we already forbid on a standby, for the same reason, so maybe it won't be as hard to identify them as I feared. I wonder whether we should envision this as "demote primary to standby" rather than an independent feature. >> I also think that putting such a thing into ALTER SYSTEM has got big >> logical problems. > ... no right-thinking person would ever propose to > change a feature that renders the system read-only in such a way that > it was impossible to deactivate it. That would be nuts. My point was that putting this in ALTER SYSTEM paints us into a corner as to what we can do with ALTER SYSTEM in the future: we won't ever be able to make that do anything that would require writing WAL. And I don't entirely believe your argument that that will never be something we'd want to do. regards, tom lane