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 1i0TQU-0005Gp-JC for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Aug 2019 16:25:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i0TQR-0000dB-Kv for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Aug 2019 16:25:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i0TQR-0000Sy-7P for pgsql-hackers@lists.postgresql.org; Wed, 21 Aug 2019 16:25:31 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1i0TQK-0002Wo-10 for pgsql-hackers@postgresql.org; Wed, 21 Aug 2019 16:25:29 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 2764F5F79F; Wed, 21 Aug 2019 12:25:22 -0400 (EDT) Date: Wed, 21 Aug 2019 12:25:22 -0400 From: Stephen Frost To: Tom Lane Cc: Ian Barwick , Robert Haas , Tomas Vondra , Amit Kapila , "pgsql-hackers@postgresql.org" Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions Message-ID: <20190821162521.GD16436@tamriel.snowman.net> References: <30823.1565030571@sss.pgh.pa.us> <32103.1565032053@sss.pgh.pa.us> <20190806005225.GM29202@tamriel.snowman.net> <6cba0dff-485b-6781-d659-0a376b966c89@2ndquadrant.com> <20190806021616.GP29202@tamriel.snowman.net> <54620b18-60b7-4b9b-7d1d-90a6464ab333@2ndquadrant.com> <5879.1565121423@sss.pgh.pa.us> <20190806214355.GA29202@tamriel.snowman.net> <29770.1565810142@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="TLTCiq8VFLhFIWrm" Content-Disposition: inline In-Reply-To: <29770.1565810142@sss.pgh.pa.us> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --TLTCiq8VFLhFIWrm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Greetings, * Tom Lane (tgl@sss.pgh.pa.us) wrote: > + > + External tools may also > + modify postgresql.auto.conf. It is not > + recommended to do this while the server is running, since a > + concurrent ALTER SYSTEM command could overwrite > + such changes. Such tools might simply append new settings to the end, > + or they might choose to remove duplicate settings and/or comments > + (as ALTER SYSTEM will). > While I don't know that we necessairly have to change this langauge, I did want to point out for folks who look at these things and consider the challenges of this change that simply appending, when it comes to things like backup tools and such, is just not going to work, since you'll run into things like this: FATAL: multiple recovery targets specified DETAIL: At most one of recovery_target, recovery_target_lsn, recovery_target_name, recovery_target_time, recovery_target_xid may be set. That's from simply doing a backup, restore with one recovery target, then back that up and restore with a different recovery target. Further there's the issue that if you specify a recovery target for the first restore and then *don't* have one for the second restore, then you'll still end up trying to restore to the first point... So, basically, appending just isn't actually practical for what is probably the most common use-case these days for an external tool to go modify postgresql.auto.conf. And so, every backup tool author that lets a user specify a target during the restore to generate the postgresql.auto.conf with (formerly recovery.conf) is going to have to write enough of a parser for PG config files to be able to find and comment or remove any recovery target options from postgresql.auto.conf. That'd be the kind of thing that I was really hoping we could provide a common library for. Thanks, Stephen --TLTCiq8VFLhFIWrm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJdXXBxAAoJEO1sijiDR2RVrnIP/1FQij+yp0FDcwP7zy9+eIIe NjQQQd07NZo8GAyiElTJEezxAzl7IF3dzkCJUIrwdJL58vYqT5G+Pl5JaQFrTbeG H2/d38YL6snsUZC745bBUKctm1KoCvKLQSE8fmNastYDoLTcJVaW4wmUZm2oPrST 9CIz3EJ472wNa0qbFSbpPJpSN9CId/5PzTo3JWFr3XWupLr1hmONhlsyePfxfEfw bfVQJw80vw5ZqEIivsrGbo35af3+x1K3O5QkZAnwUz5gmwhpxkf2ruDc/zsl4qCa yS5MgpgDmE9WdTPqWqPLEysLAlaiqWBEZ8r1FZIsfgHz8tuibcy3IOwIGcoShEIe oNK6AbPPoqiwJRNFYrcg6NFTGoPoxcXORJyUxOOGFL4QP3m4ez7TKYR1ewkw3u83 sm8/Hetq/wbVqUNNRvuleEUzdUzLdh9bUfst3QdLRlz/piHS/Pvp/JqXNELATxSX Amp2Oe/se//wYZajm+WWO346G372ymsf9FQeMjXe/BVPCkzwEYgxEIv+iyke0Arh MxYdgu4bGnhRXCNzYDSI7KQ+o1QWXO6WLCwwJNp9muajqpMZi7fXFB5unXjKB/sV OZLwA2eqxIkEVzjrpMAEgSope9PayPF7pX5ICKqUt0hkQK0A9maE/TmaCjGB5W9n QPejWrfPgH/5j7uB5+Pv =jnSS -----END PGP SIGNATURE----- --TLTCiq8VFLhFIWrm--