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 1gRKZX-0007oL-Hc for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Nov 2018 17:21:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gRKZW-0008QX-DN for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Nov 2018 17:21:22 +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 1gRKZW-0008QQ-2i for pgsql-hackers@lists.postgresql.org; Mon, 26 Nov 2018 17:21:22 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gRKZT-0003IJ-Bt for pgsql-hackers@postgresql.org; Mon, 26 Nov 2018 17:21:20 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id A94A45F7A4; Mon, 26 Nov 2018 12:21:18 -0500 (EST) Date: Mon, 26 Nov 2018 12:21:18 -0500 From: Stephen Frost To: Sergei Kornilov Cc: Michael Paquier , Peter Eisentraut , Postgres hackers Subject: Re: pgsql: Integrate recovery.conf into postgresql.conf Message-ID: <20181126172118.GY3415@tamriel.snowman.net> References: <20181126002849.GD1776@paquier.xyz> <27802171543235530@iva2-6ec8f0a6115e.qloud-c.yandex.net> <20181126131640.GD14598@paquier.xyz> <20181126151852.GW3415@tamriel.snowman.net> <29465041543250389@iva4-f774db2b5297.qloud-c.yandex.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="O1+DDjaLRatPxzPT" Content-Disposition: inline In-Reply-To: <29465041543250389@iva4-f774db2b5297.qloud-c.yandex.net> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --O1+DDjaLRatPxzPT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Greetings, * Sergei Kornilov (sk@zsrv.org) wrote: > > I would think we'd have the different GUCs and then the check functions > > would only validate that they're valid inputs and then when we get to > > the point where we're starting to do recovery we check and make sure > > we've been given a sane overall configuration- which means that only > > *one* is set, and it matches the recovery target requested. > How about something like attached patch? I've not been following this very closely, but seems like recovery_target_string is a bad idea.. Why not just make that 'recovery_target_immediate' and make it a boolean? Having a GUC that's only got one valid value seems really odd. > + if (targetSettingsCount > 1) > + ereport(FATAL, > + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), > + errmsg("can not specify multiple recovery targets"))); I think I would have done 'if (targetSettingsCount != 1)' here. > -# Multiple targets > -# Last entry has priority (note that an array respects the order of items > -# not hashes). You could (and imv should) include a test that throws an expected error if multiple targets are specified. Thanks! Stephen --O1+DDjaLRatPxzPT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJb/CuOAAoJEO1sijiDR2RVCqkP/1bQjFsDZXfyXT7Bo48dt3gO KNDnYk0WqXp6J9YPccIw8Cu4omwxyhdO9ZpUGsZ4KZy4jNPPiG/tOQ8JDttVMQC1 9ho0Ft9w9wpfdoLCjNMmxIZThN8rAJjhsDU0VZCiKmp3R7/hixx8avMNMFDSn6s9 xxDP/xdRD4Q4L2g97RVb21v5t0I/r/EbYuyEb8sB7eK8Nt91/cI7q+z1gWDgR++3 yjgb5LNSshuqH2wPiIXE/o31c/PAJEfhwFbyN2cAtWf9n4K4/oHsIIayb97ZXU4o bH1HsB66pkR4nog1TnGICM4YENeDpjetjQxK8xKLN4AGkfOG/uZb08iMBGmX8xnQ QUI9/+BxszrJyhW9jGzoE/AXnhoaruf+64aO67icMjwuqTx74zjMYXlpfcj/0tYY OJMbv+AXjbVd1PCut5b9if58WeB6Dflmqp5D43kTx2H3SyifJkzwhf0doEOLry9Z ltiCLjrMYwk9X2/Y0FyGRkwD68BUvuUObDmrN/GNtCjGplv49pqay2JptGlkP6fw 21q7lLrAxumNiYr6SCr6CnFMLNEQZG/GV/FNzUi+H2znjJfmKJ0L2tyXSYMmNfvG d7awKcGvJnHc1Q/DIuxelPXAl6TuqkKpM+0CGIMIrg3UEfYojuV6k9rYvCrsjeEF L58/k+irRgWtJ5XYQa3l =Af3p -----END PGP SIGNATURE----- --O1+DDjaLRatPxzPT--