Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wd0nC-003ows-1g for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jun 2026 07:16:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wd0nA-009mY1-0A for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jun 2026 07:16:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wd0n9-009mXt-2X for pgsql-hackers@lists.postgresql.org; Fri, 26 Jun 2026 07:15:59 +0000 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wd0n7-00000000K9j-3b7n for pgsql-hackers@lists.postgresql.org; Fri, 26 Jun 2026 07:15:59 +0000 Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-c8deb37737dso213931a12.1 for ; Fri, 26 Jun 2026 00:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782458156; x=1783062956; darn=lists.postgresql.org; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=3JZTUR/XWpUBnr+o3CoIsGbCpT3pBbcxKppRxuPp5jw=; b=rVuxF6XNYAK6eA1X/mU6aHtY4k9H7Kz2Y0BdrWOtxmf9nlXh5CNUIomYHbZohFZhiX H/F4kGG6zS7PyhdeXVi0syDGuXFR5/HbDpwQRhDuyMHr3X00EIExI/gmMiADyynfbF+v QyM9VYLuzs6rTWJFQ6qF+c5j+56gSRZu0xhx9OdF8W+FTlQFlRhCZc2Yx7IHM3Zwr0w6 9ASvrnjAj4eDOxPLq8nCK3a62q+lHQH9oAPxnnMGZx+kNHc6Xq+Z8OmxVILtgLzn8iyj TILWAClEsoDOrJ+Xt85ndxmDqYFA4nmHXSVEkvyF2FZChdIkSxpJUbFr4BdlXwkIUsrW 6gMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782458156; x=1783062956; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3JZTUR/XWpUBnr+o3CoIsGbCpT3pBbcxKppRxuPp5jw=; b=YWgsLXYaXaq+PSsxNUXiwmn/Af7/1iFZUbakZU4dxqU1VfufPVDqJNQGO7nY5WmTLA O75F9CeqzActo5w9WUpa5mRkfOBh7/nTZ6PChqA75oNUnHimYK/O/bnp7cE+wbPyZ8CY kKm0PiDY+oUqyhRolbqFYuwYRJqs+sJw2iEeYpGqMOysnaoVgkLedmC2J89/aKdzvpvX e2ef9DxYx2TE9P68bpj5+2RsFpYpZfcL2V2skE5Ezj3S7cvDdZiR9B4nMQxhLUW9y0N0 JBQIGtqp0cSepBTLG8LGMZ0QhLdHVcH+UJoip7wPv+1Uac8qGDXzMdOXRAyr5TagfLRm PtEg== X-Forwarded-Encrypted: i=1; AFNElJ+bs73zgK3b4pF0/2Rm+160K4Uf51ZaCfIX6qy3sswmsyvXcSyg4CmwjyKZDlQMLzIoXnXRPgFT55GdBU+/@lists.postgresql.org X-Gm-Message-State: AOJu0YzG7eR9SGr4Mto1d1UDZdSSKlNjZY3Z4TkQptO4IXFXd1mP9IKo +MdE6aO3raO/WwsQLCsNw9qrLobd4y//3EklhOOztjPfOYTBqwI2ZXBR X-Gm-Gg: AfdE7cnaxNVbTLks6B2dOZnFrKgL4kehkH863j25kKNFc1gvnkBGn0KolG24lxsyn+x 29CRu+YXsMoXeqSbnRGr+nNdyXrnkVwg5v829lsqv7DPnv5h7yHit1FCqxQay6i9zTF0wsgo3YP OUrH0Cj+iUCDUCr0856pTBOXQOMuwCoIt0hcgZWXEyqGUo3+OM+wsU96xJVMidG1agENzzocvLC vP6gJ5JLPlb8/h33NZIqGPXfRWUUF1YU/5FbQrPCOEayo9X9nrZEQinrxkRleJug86FAckfvpPC bFC1ReoiM3BmQ8LX8/xpCXeuOm6KMlDOp347YM3jl1PfE2sv4PSFNJrY2pEccS8ZZpBo+6w/MzK jG3ghDf5f4FmvOYljYD6Jj0qQsVZ8pQVIR/E3EEeZhQo5B1NGpN0X79iX+yRO/nHT8LvGUTh8C1 Lygu4eOGNVxxApRxC9GOgmzzzxNK4E6QIa+ijw3w/dzKd10LnjDyqzPVTTh2+b X-Received: by 2002:a05:6a20:7487:b0:3bf:66b3:7b3e with SMTP id adf61e73a8af0-3bf66b37e3dmr41555637.22.1782458156065; Fri, 26 Jun 2026 00:15:56 -0700 (PDT) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c92b9cc8496sm2840123a12.8.2026.06.26.00.15.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2026 00:15:55 -0700 (PDT) Date: Fri, 26 Jun 2026 16:15:53 +0900 (JST) Message-Id: <20260626.161553.236415645647775260.horikyota.ntt@gmail.com> To: michael@paquier.xyz Cc: sjh910805@gmail.com, alvherre@kurilemu.de, scott@scottray.io, masao.fujii@gmail.com, pgsql-hackers@lists.postgresql.org Subject: Re: [PATCH] Don't call ereport(ERROR) from recovery target GUC assign hooks From: Kyotaro Horiguchi In-Reply-To: References: User-Agent: Mew version 6.8 on Emacs 29.4 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, I spent some time thinking about this issue and the proposed patch, and I wonder if we can simplify it a bit further. If we don't want to rely on GUC hooks for cross-checking multiple recovery target settings, perhaps the assign hooks could stop updating the shared recoveryTarget state altogether and only maintain their own underlying variables. As far as I can tell, the existing recovery target variables already seem sufficient to determine whether each target is configured. The only exception appears to be recovery_target = 'immediate', which would probably need an additional boolean flag (or similar state) to represent whether it has been specified. Then validateRecoveryParameters() could determine which recovery target is configured by inspecting those variables directly, report an error if more than one target is set, and reconstruct the same recoveryTarget state that the current code expects. Does that make sense? Regards, -- Kyotaro Horiguchi NTT Open Source Software Center