Re: doc patch: wrong descriptions for dropping replication slots

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Cc: "'pgsql-hackers(at)lists(dot)postgresql(dot)org'" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: doc patch: wrong descriptions for dropping replication slots
Date: 2025-03-19 16:41:55
Message-ID: ccc26724-af26-4279-baeb-b40621a712a3@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)hayato(at)fujitsu(dot)com>
Reviewed-by: Fujii Masao <masao(dot)fujii(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2025-03-19 16:44:38 Re: optimize file transfer in pg_upgrade
Previous Message Robert Haas 2025-03-19 16:41:48 Re: making EXPLAIN extensible