Re: Lingering replication slots

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Lou Tseng <ltseng(at)advancedpricing(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Lingering replication slots
Date: 2019-04-03 16:27:10
Message-ID: 48619cc6-a89d-6fd7-07f1-580a8effb607@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 4/3/19 9:01 AM, Lou Tseng wrote:
> Hi,
>
> A newbie question: how do I delete lingering replication slots?  When
> creating Subscription for logical replication, the CREATE SUBSCRIPTION
> stuck and didn't return. After ctrl-c and aborted the command, the
> master database have lingering replication slots that I can't delete
> because the active is true. Do I just kill the pid?
>
> Thanks!
>
>
> SELECT * FROM pg_replication_slots ;
>
> slot_name |plugin| slot_type |datoid|database| temporary | active |
> active_pid | xmin | catalog_xmin | restart_lsn| confirmed_flush_lsn
>
> --------------+----------+-----------+----------+----------------+-----------+--------+------------+------+--------------+--------------+---------------------
>
> support_sub2 | pgoutput | logical | 28384483 | dragon_support | f |
> t|29566 || 96562907 | 5108/29C1610 |
>
> support_sub| pgoutput | logical | 28384483 | dragon_support | f |
> t|27253 || 96562907 | 5108/2858880 |
>

See below(read full description at link):

https://www.postgresql.org/docs/11/functions-admin.html#FUNCTIONS-REPLICATION

pg_drop_replication_slot(slot_name name)

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gmail 2019-04-03 16:28:17 Re: stale WAL files?
Previous Message david moloney 2019-04-03 16:26:00 PostgreSQL Windows 2019 support ?