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.94.2) (envelope-from ) id 1tku1S-007jJO-Dq for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Feb 2025 00:02:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tku1Q-00Fgmd-Mk for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Feb 2025 00:02:32 +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.94.2) (envelope-from ) id 1tku1Q-00Fglk-Cx for pgsql-hackers@lists.postgresql.org; Thu, 20 Feb 2025 00:02:32 +0000 Received: from fout-a1-smtp.messagingengine.com ([103.168.172.144]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tku1O-001rRw-0W for pgsql-hackers@lists.postgresql.org; Thu, 20 Feb 2025 00:02:32 +0000 Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id 69EF413809AF; Wed, 19 Feb 2025 19:02:28 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Wed, 19 Feb 2025 19:02:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1740009748; x=1740096148; bh=EzYr3rKHqr 7+bfZTZYqjQ1F3rpaGk5tblUhM1Lc5oUc=; b=SfQcFn5kPE45VChsML1JAtGy3J 1jazJtC/j6+nqHijj8egTzDBQm8NneG9nHmfl6BIdBe5jSCjUBZWEJKPCudte3qp SXshJvgWMM6Muzn0J8kPrwnfDn/VJYqcb7xPp/qVhNYSxmDhct99RnRHyyt4F4cE pc4I/eTMX+RrfwNVtebOffGGKdGPPB6nNSfuOBpfIofmqpi0LoHCtxq0Q6rdRJea RHjsGO0y1MXASBIcslwjn4foeDfdlU7X46gbXxz59uWOnJcEKf4B7Mbb/tHvW/q/ xnONcFeYUFwymxKFMJQR/w5f7c0fiJo7sfhRQ5YKisEL5xe1Sgg+uhq07uRA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1740009748; x=1740096148; bh=EzYr3rKHqr7+bfZTZYqjQ1F3rpaGk5tblUh M1Lc5oUc=; b=s4Li1ZBu5tMRt5N6GPoyRce1Le/UQgRdEwXxyamIoRGFJMfl6uK ZheJzr9j7xImfm8uBUh3GrpsgsYCUT5TiqDmPZ+Se5HtLQyfGtDdstlJxJ6wAjH9 zvbBZer7hFzP/RdqD5FQs0+rB7eV/wHUhHLH8Y0Ip0rPT82EdOttUdOwBNeeIjO8 67vME6n/s0UYIvwh0KawWqfq1qRNpqCir3FWS0oxqJo+TuZilUSSFfKCLd4OOD7D 0qzodoHe6xXh4MdQKdhEdorlS8+lAjhMrszI+mZ9BBr8S7Kuq8ILwMsKc9YVDL3C 2kxomOeK4ugX2bAUmK+pxYDAXSfbLWeWdcQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeiheeihecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenfghrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffk fhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrh cuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeet leeifedufffhhfdtteelgeeggeffhfekueevteeigfduudevudetgfegiedvjeenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghl sehprghquhhivghrrdighiiipdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopehkuhhrohgurgdrhhgrhigrthhosehfuhhjihhtshhurdgtohhm pdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvg hsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 19 Feb 2025 19:02:26 -0500 (EST) Date: Thu, 20 Feb 2025 09:02:19 +0900 From: Michael Paquier To: "Hayato Kuroda (Fujitsu)" Cc: "'pgsql-hackers@lists.postgresql.org'" Subject: Re: ReplicationSlotRelease() crashes when the instance is in the single user mode Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="h3gIWfDe4ulSRIbZ" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --h3gIWfDe4ulSRIbZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Feb 19, 2025 at 02:57:34AM +0000, Hayato Kuroda (Fujitsu) wrote: > Based on the discussion, I feel it is enough to add quick error out > for SQL functions. PSA attached. I did not check how these call behave individually, just a few comments while putting my eyes on the patch. + if (!IsUnderPostmaster) + elog(ERROR, + "slot operation is prohibited in the single user mode"); elog() should not be used for failures that can be user-facing as this would not provide any translation. I'd suggest rewording the error message to provide some more context, as well, say: "cannot use %s in single-user mode", "function_name" -- Michael --h3gIWfDe4ulSRIbZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAme2cQsACgkQnvQgOdby QH3irw/+PsXQOl8y0zYSkhwAQp9rNmwD4NZgBT/RYs5LTakSAx6OkPCNrVCRYIZa 8evRreFQiW3O7wHd4D/ATQ85k+LY8QtYsIvNuqBk9/AfLcTc4uHh0beCaINlUj/r ZUpQpycl6Twd5YvAslZ9hllSblVWR30hVm15DhVfV3rvYVRFQqlLG4IeuLRNpgf+ 06LJiuCkvc6QhpKYKN4NYudUq/9nXwv9QAnvV/PtroV8KUddy1ohrR4xWeNwDILe ZUdljlVJP4n3J4BC5PeJ0CmJfA4fc84b+hl7ES2Wiovm43k5wqSuSKVxzr3u4ISy nyEOsWu5Ze/Gs7B0zei89JPbYuM3J1Q4YqsRGMU8SCdFu+TZLr1lwxT7iyL6yayx QfZchH/hlGLydH2GXecLvvbzrRQ8036V+BWrQCoD0LdBkc0MDbokLc/joc197YpG 5VfBnGgYJgntaOaoq4m+RbrZXMXrx2irxwHApUh6FW1F8oqOjX8jFAxeKphMKWIe W/A/OD29gl16YeiNsUcHGpqtJqvoM2ZknGKM0377DkOsK9adWguUcDo+ywZqCCA9 c1cz7a3iWZbdYHXy8jbZFvwTPWWF9JdYd9I9GqDUuX22vxhA/ByI4kN1lJIQUkHI 2wqmump+p9LzQj6NKeqe2UsZZYL1kkDhpidavJLD/53Mtyj7HzY= =5hv2 -----END PGP SIGNATURE----- --h3gIWfDe4ulSRIbZ--