Re: doc patch: wrong descriptions for dropping replication slots - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: doc patch: wrong descriptions for dropping replication slots
Date
Msg-id ccc26724-af26-4279-baeb-b40621a712a3@oss.nttdata.com
Whole thread Raw
In response to RE: doc patch: wrong descriptions for dropping replication slots  ("Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>)
Responses RE: doc patch: wrong descriptions for dropping replication slots
List pgsql-hackers

On 2025/03/19 11:07, Hayato Kuroda (Fujitsu) wrote:
> Dear Fujii-san,
> 
>> Why was this restriction removed? If there was a past discussion about it,
>> could you share the details?
> 
> More properly, pg_drop_replication_slot() has been introduced since PG9.4, and old
> documents did not have the description. The description has been added while
> developing PG10 and kept till now.
> 
> The restriction was introduced in v1 patch and removed in v2 patch [1].
> ISTM there were no discussions in the thread. I tried to find the initial design
> of the function, but I could not find.
> 
>> Since it's generally expected that a session in one database shouldn't
>> be able to drop objects in another, I'm wondering if removing this
>> restriction was intentional or possibly a bug.
> 
> I think the description was accidentally retained. As I said above, replication slot
> can be dropped from anywhere since PG9.4. Andres pointed out the description was
> not needed in post-commit review [2]. Craig posted a follow-up patch [3], but it was
> missed.

Thanks for the clarification! I agree that the description is incorrect
and should be removed.

Unless there are any objections, I plan to push your patch with
the following commit message and back-patch it to all supported versions.

-------
doc: Remove incorrect description about dropping replication slots.

pg_drop_replication_slot() can drop replication slots created on
a different database than the one where it is executed. This behavior
has been in place since PostgreSQL 9.4, when pg_drop_replication_slot()
was introduced.

However, commit ff539d mistakenly added the following incorrect
description in the documentation:

     For logical slots, this must be called when connected to
     the same database the slot was created on.

This commit removes that incorrect statement. A similar mistake was
also present in the documentation for the DROP_REPLICATION_SLOT
command, which has now been corrected as well.

Back-patch to all supported versions.

Author: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/OSCPR01MB14966C6BE304B5BB2E58D4009F5DE2@OSCPR01MB14966.jpnprd01.prod.outlook.com
Backpatch-through: 13
-------

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION




pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: making EXPLAIN extensible
Next
From: Andres Freund
Date:
Subject: Re: optimize file transfer in pg_upgrade