The following bug has been logged on the website:
Bug reference: 15195
Logged by: mariel cherkassky
Email address: mariel.cherkassky@gmail.com
PostgreSQL version: 10.4
Operating system: red hat 7
Description:
I tried to create a subscription in a database(database name : jsondb) that
has a different name from the database(database name : marieldb) in the
publisher. I succeeded. Then I created another database(jsondb) in the
subscriber server and in the new database (jsondb)I created a new
subscription with the same name of the previous subscription that I created
(in the database jsondb).
Summary :
publication server :
1 database : jsondb
subscriber server :
2 databases : jsondb,marieldb
in jsondb and in marieldb there are subscribers with the same name :
marieldb=# \dRs+
List of
subscriptions
Name | Owner | Enabled | Publication | Synchronous commit |
Conninfo
---------+----------+---------+-------------+--------------------+-------------------------------------------------------
-----------
my_sub1 | postgres | t | {pub1} | off |
dbname=jsondb host=my_ip user=rep password=rep
port=5432
(1 row)
marieldb=# \q
[pg2]$ psql -d jsondb;
psql (10.4)
Type "help" for help.
jsondb=# \dRs+
List of
subscriptions
Name | Owner | Enabled | Publication | Synchronous commit |
Conninfo
---------+----------+---------+-------------+--------------------+-------------------------------------------------------
-----------
my_sub1 | postgres | t | {my_pub} | off |
dbname=jsondb host=my_ip user=rep password=rep
port=5432
(1 row)
The problem is when I'm trying to delete one of them I cant because it is
seems that it is used :
jsondb=# \dRs+
List of
subscriptions
Name | Owner | Enabled | Publication | Synchronous commit |
Conninfo
---------+----------+---------+-------------+--------------------+-------------------------------------------------------
-----------
my_sub1 | postgres | f | {my_pub} | off |
dbname=jsondb host=172.22.13.121 user=rep password=rep
port=5432
(1 row)
jsondb=# drop subscription my_sub1;
stuck..
I tried to disable the subscriber in jsondb and drop the database but I'm
getting error :
postgres=# drop database jsondb;
ERROR: database "jsondb" is being used by logical replication
subscription
DETAIL: There is 1 subscription.