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 1jLgEl-0004rN-CK for pgsql-general@arkaria.postgresql.org; Tue, 07 Apr 2020 04:53:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jLgEj-0005m1-LA for pgsql-general@arkaria.postgresql.org; Tue, 07 Apr 2020 04:53:21 +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 1jLgEj-0005lt-Da for pgsql-general@lists.postgresql.org; Tue, 07 Apr 2020 04:53:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jLgEc-0000w8-5W for pgsql-general@lists.postgresql.org; Tue, 07 Apr 2020 04:53:20 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 0374rB59025512; Tue, 7 Apr 2020 00:53:11 -0400 From: Tom Lane To: "David G. Johnston" cc: AC Gomez , "pgsql-generallists.postgresql.org" Subject: Re: what happens when you issue ALTER SERVER in a hot environment? In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Mon, 06 Apr 2020 21:29:37 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <25510.1586235191.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 07 Apr 2020 00:53:11 -0400 Message-ID: <25511.1586235191@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "David G. Johnston" writes: > On Monday, April 6, 2020, AC Gomez wrote: >> If you issue an ALTER SERVER command and there are active connections >> with that server in use or new ones are coming in, what happens? Docs o= n >> this command say nothing regarding active processing using the server >> context and changes to it. So I assume it's just handled. > Not sure if there are exceptions but assume that nothing external will > change your current active session=E2=80=99s settings out from underneat= h you. Couple of comments here: * ALTER SERVER changes nothing until "pg_ctl reload" or similar is issued. The same goes for manually editing the config file (which is more or less the same thing, though on a different file). * Once you do issue a reload, individual sessions will adopt the new setting reasonably promptly, though not necessarily all at the same instant (assuming it's a setting that doesn't require a postmaster restart to take effect, in which case nothing happens). * A session that has a higher-priority source for the setting of a given GUC, such as a locally-issued SET, is not going to adopt the new setting from the config file. But it *will* adopt that setting on-the-fly if it has no other source of the setting. The priority rules are explained in the fine manual, IIRC. Possibly some clarification is needed? >> For example if you alter user/password, I assume that as long as prior >> user password is still good that actively running processes will keep g= oing. > If you alter a password the old one is by definition no longer good...bu= t > it doesn=E2=80=99t matter because authentication only happens once - dur= ing login. Right. Also, passwords are *not* managed through the GUC (server parameter) mechanism; what I just said about GUCs doesn't apply to them. regards, tom lane