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.hay...@fujitsu.com>
Reviewed-by: Fujii Masao <masao.fu...@gmail.com>
Discussion:
https://postgr.es/m/oscpr01mb14966c6be304b5bb2e58d4009f5...@oscpr01mb14966.jpnprd01.prod.outlook.com
Backpatch-through: 13
-------
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION