[PATCH] Fix typo in pgstat_replslot.c

Started by zengman5 days ago3 messages
#1zengman
zengman@halodbtech.com
1 attachment(s)

Hi,

I noticed this could be corrected to `exists` (instead of `exits`) here, same as commit 63ed3bc7f9a66035e0b741aaa542de35a90fe1cc.
```c
/* Check if the slot exits with the given name. */
slot = SearchNamedReplicationSlot(name, false);

if (!slot)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("replication slot \"%s\" does not exist",
name)));
```

--
Regards,
Man Zeng
www.openhalo.org

Attachments:

0001-This-should-be-exists-here-instead-of-exits-consiste.patchapplication/octet-stream; charset=ISO-8859-1; name=0001-This-should-be-exists-here-instead-of-exits-consiste.patchDownload
From b4a64302a3456f3d2a4db216f92756315beca707 Mon Sep 17 00:00:00 2001
From: Man Zeng <zengman@halodbtech.com>
Date: Wed, 7 Jan 2026 19:06:06 +0800
Subject: [PATCH] This should be exists here instead of exits, consistent with
 commit 63ed3bc7f9a66035e0b741aaa542de35a90fe1cc.

---
 src/backend/utils/activity/pgstat_replslot.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/backend/utils/activity/pgstat_replslot.c b/src/backend/utils/activity/pgstat_replslot.c
index ec161d48578..168ef8f8f45 100644
--- a/src/backend/utils/activity/pgstat_replslot.c
+++ b/src/backend/utils/activity/pgstat_replslot.c
@@ -47,9 +47,8 @@ pgstat_reset_replslot(const char *name)
 
 	LWLockAcquire(ReplicationSlotControlLock, LW_SHARED);
 
-	/* Check if the slot exits with the given name. */
+	/* Check if the slot exists with the given name. */
 	slot = SearchNamedReplicationSlot(name, false);
-
 	if (!slot)
 		ereport(ERROR,
 				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-- 
2.43.0

#2Amit Kapila
amit.kapila16@gmail.com
In reply to: zengman (#1)
Re: [PATCH] Fix typo in pgstat_replslot.c

On Wed, Jan 7, 2026 at 4:52 PM zengman <zengman@halodbtech.com> wrote:

I noticed this could be corrected to `exists` (instead of `exits`) here, same as commit 63ed3bc7f9a66035e0b741aaa542de35a90fe1cc.
```c
/* Check if the slot exits with the given name. */
slot = SearchNamedReplicationSlot(name, false);

if (!slot)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("replication slot \"%s\" does not exist",
name)));
```

oops, we should have caught it last time along with commit
63ed3bc7f9a66035e0b741aaa542de35a90fe1cc but anyway I checked there is
no more similar typo in the code. So, the patch LGTM.

--
With Regards,
Amit Kapila.

#3zengman
zengman@halodbtech.com
In reply to: Amit Kapila (#2)
Re: [PATCH] Fix typo in pgstat_replslot.c

oops, we should have caught it last time along with commit
63ed3bc7f9a66035e0b741aaa542de35a90fe1cc but anyway I checked there is
no more similar typo in the code. So, the patch LGTM.

Hi Mr. Amit,

Thank you for confirming. I also couldn't find a similar error.

--
Regards,
Man Zeng
www.openhalo.org