Simone Gotti wrote:
> Hi all,
> 
> I noticed that in postgres 10beta3, calling pg_drop_replication_slot on an
> active slot will block until it's released instead of returning an error
> like
> done in pg 9.6. Since this is a change in the previous behavior and the docs
> wasn't changed I made a patch to restore the previous behavior.

Changing that behavior was the entire point of the cited commit.

A better fix, from my perspective, is to amend the docs as per the
attached patch.  This is what would be useful for logical replication,
which is what replication slots were invented for in the first place.
If you disagree, let's discuss what other use cases you have, and we can
come up with alternatives that satisfy both.  I think a decent answer,
but one which would create a bit of extra churn, would be to have an
optional boolean flag in the command/function for "nowait", instead of
hardcoding either behavior.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>From 5761b79c6ebc4f6dfaf4d2489e9bff47b9e0c3ad Mon Sep 17 00:00:00 2001
From: Alvaro Herrera <alvhe...@alvh.no-ip.org>
Date: Tue, 29 Aug 2017 12:08:47 +0200
Subject: [PATCH] Document that DROP_REPLICATION_SLOT now waits

---
 doc/src/sgml/protocol.sgml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index 7c012f59a3..e61d57a234 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -2179,7 +2179,8 @@ The commands accepted in walsender mode are:
     <listitem>
      <para>
       Drops a replication slot, freeing any reserved server-side resources. If
-      the slot is currently in use by an active connection, this command fails.
+      the slot is currently in use by an active connection, this command waits
+      until the slot becomes free.
       If the slot is a logical slot that was created in a database other than
       the database the walsender is connected to, this command fails.
      </para>
-- 
2.11.0

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to