RE: doc patch: wrong descriptions for dropping replication slots

From: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: 'Fujii Masao' <masao(dot)fujii(at)oss(dot)nttdata(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 02:07:23
Message-ID: OSCPR01MB149661AA4E16385C19C9E9168F5D92@OSCPR01MB14966.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

[1]: https://www.postgresql.org/message-id/CAMsr%2BYEsrUf0sq9RtK7cy2wM7%2BpUQQ22LzPU-FzVOBL7PROwhg%40mail.gmail.com
[2]: https://www.postgresql.org/message-id/20170328152238.h3ikwwsl5kbqq6nk%40alap3.anarazel.de
[3]: https://www.postgresql.org/message-id/CAMsr%2BYFdRMxFNvofWyBJ1zdhFgEBHZf%3D0TWrt9Z3QRSWLepvgQ%40mail.gmail.com

Best regards,
Hayato Kuroda
FUJITSU LIMITED

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2025-03-19 02:09:07 Re: Optimize truncation logic to reduce AccessExclusive lock impact
Previous Message Euler Taveira 2025-03-19 02:01:02 Re: Proposal: Deferred Replica Filtering for PostgreSQL Logical Replication