doc patch: wrong descriptions for dropping replication slots

From: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: "'pgsql-hackers(at)lists(dot)postgresql(dot)org'" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: doc patch: wrong descriptions for dropping replication slots
Date: 2025-03-18 08:46:42
Message-ID: OSCPR01MB14966C6BE304B5BB2E58D4009F5DE2@OSCPR01MB14966.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear hackers,

While considering another thread, I found the $SUBJECT. Attached patch fixes it.

Documentation says:

```
pg_drop_replication_slot ( slot_name name ) → void

Drops the physical or logical replication slot named slot_name. Same as replication protocol command DROP_REPLICATION_SLOT.
For logical slots, this must be called while connected to the same database the slot was created on.
```

But this is not correct. Backend processes which connect to other databases
can drop the logical slot:

```
postgres=# SELECT * FROM pg_create_logical_replication_slot('test', 'test_decoding');
slot_name | lsn
-----------+-----------
test | 0/1CA6A18
(1 row)

postgres=# \c tests
You are now connected to database "tests" as user "postgres".
tests=# SELECT * FROM pg_drop_replication_slot('test');
pg_drop_replication_slot
--------------------------

(1 row)
```

IIUC, the description was added by ff539d. The initial version [1] seemed to have
the restriction, it was removed now but the description retained.

I think all supported versions have the same issue, attached one is for master.

Thanks Hou for confirming the issue.

[1]: https://www.postgresql.org/message-id/CAMsr%2BYGjZRqo-boCF9z5Bc1WZ_10RjMLtNSTsaa%3DkkE9_GmTag%40mail.gmail.com

Best regards,
Hayato Kuroda
FUJITSU LIMITED

Attachment Content-Type Size
0001-Fix-description-for-dropping-slots.patch application/octet-stream 1.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Anthonin Bonnefoy 2025-03-18 08:55:21 Re: Add Pipelining support in psql
Previous Message David Rowley 2025-03-18 08:24:06 Re: Query ID Calculation Fix for DISTINCT / ORDER BY and LIMIT / OFFSET