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>, "'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-18 15:06:52
Message-ID: 071b1253-f3c0-4fd4-a3fe-7b361d433556@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2025/03/18 17:46, Hayato Kuroda (Fujitsu) wrote:
> Dear hackers,
>
> While considering another thread, I found the $SUBJECT. Attached patch fixes it.

Thanks for the patch!

> 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.

Why was this restriction removed? If there was a past discussion about it,
could you share the details?

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.

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-18 15:07:14 Re: ecdh support causes unnecessary roundtrips
Previous Message Ilia Evdokimov 2025-03-18 14:57:19 Re: Add missing tab completion for VACUUM and ANALYZE with ONLY option