Re: DROP SUBSCRIPTION with no slot
От | Jeff Janes |
---|---|
Тема | Re: DROP SUBSCRIPTION with no slot |
Дата | |
Msg-id | CAMkU=1wJHO5SiLEQCGf6gWiF93D_dFqM4qZqRGW0VP-mMG8a1Q@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: DROP SUBSCRIPTION with no slot (Ziga <ziga@ljudmila.org>) |
Ответы |
Re: DROP SUBSCRIPTION with no slot
|
Список | pgsql-hackers |
On Tue, Sep 24, 2019 at 6:42 PM Ziga <ziga@ljudmila.org> wrote:
This also seems to be a problem for somewhat fringe case of subscriptions created with connect=false option.They cannot be dropped in an obvious way, without knowing the ALTER SUBSCRIPTION trick.For example:contrib_regression=# create subscription test_sub connection 'dbname=contrib_regression' publication test_pub with ( connect=false );WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tablesCREATE SUBSCRIPTIONcontrib_regression=# drop subscription test_sub; -- failsERROR: could not drop the replication slot "test_sub" on publisherDETAIL: The error was: ERROR: replication slot "test_sub" does not existcontrib_regression=# alter subscription test_sub set ( slot_name=none );ALTER SUBSCRIPTIONcontrib_regression=# drop subscription test_sub; -- succeedsDROP SUBSCRIPTIONNote that the publication was never refreshed.It seems that the first DROP should succeed in the above case.Or at least some hint should be given how to fix this.
There is no HINT in the error message itself, but there is in the documentation, see note at end of https://www.postgresql.org/docs/current/sql-dropsubscription.html. I agree with you that the DROP should just work in this case, even more so than in my case. But if we go with the argument that doing that is too error prone, then do we want to include a HINT on how to be error prone more conveniently?
Cheers,
Jeff
В списке pgsql-hackers по дате отправления: