How to resolve the error for “Alter Subscription disable”?
-
13-02-2021 - |
Question
I have the following subscription for logical replication:
pctest1=> SELECT subscription_name, status FROM pglogical.show_subscription_status();
subscription_name | status
-------------------------------------+-------------
sandbox_rds_pg10_subscriber | replicating
(1 row)
When I try to disable this, it returns the below error:
pctest1=> alter SUBSCRIPTION sandbox_rds_pg10_subscriber disable;
ERROR: subscription "sandbox_rds_pg10_subscriber" does not exist
No correct solution
OTHER TIPS
I figured out that the below functions will work:
pctest1=> select pglogical.alter_subscription_disable('sandbox_rds_pg10_subscriber');
-[ RECORD 1 ]--------------+--
alter_subscription_disable | t
pctest1=> select * from pglogical.show_subscription_status();
-[ RECORD 1 ]-----+------------------------------------------------------------------------------------------
subscription_name | sandbox_rds_pg10_subscriber
status | disabled
provider_node | sandbox_provider
provider_dsn | host=10.xx.xx.xx port=xxxx dbname=sandbox_uat user=admin password=xxxxxxxxxx
slot_name | pgl_pctest1_sand2c004cb_sand98307b9
replication_sets | {default}
forward_origins | {all}
pctest1=> select pglogical.alter_subscription_enable('sandbox_rds_pg10_subscriber');
-[ RECORD 1 ]-------------+--
alter_subscription_enable | t
pctest1=> select * from pglogical.show_subscription_status();
-[ RECORD 1 ]-----+------------------------------------------------------------------------------------------
subscription_name | sandbox_rds_pg10_subscriber
status | replicating
provider_node | sandbox_provider
provider_dsn | host=10.x.x.x port=xxxx dbname=sandbox_uat user=admin password=xxxxxxxx
slot_name | pgl_pctest1_sand2c004cb_sand98307b9
replication_sets | {default}
forward_origins | {all}
Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange