mirror of
https://github.com/postgres/postgres.git
synced 2025-08-02 09:26:47 +03:00
Add RENAME support for PUBLICATIONs and SUBSCRIPTIONs
From: Petr Jelinek <petr.jelinek@2ndquadrant.com>
This commit is contained in:
src
backend
bin
psql
test
regress
subscription
@ -1259,6 +1259,21 @@ reread_subscription(void)
|
||||
proc_exit(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Exit if subscription name was changed (it's used for
|
||||
* fallback_application_name). The launcher will start new worker.
|
||||
*/
|
||||
if (strcmp(newsub->name, MySubscription->name) != 0)
|
||||
{
|
||||
ereport(LOG,
|
||||
(errmsg("logical replication worker for subscription \"%s\" will "
|
||||
"restart because subscription was renamed",
|
||||
MySubscription->name)));
|
||||
|
||||
walrcv_disconnect(wrconn);
|
||||
proc_exit(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Exit if publication list was changed. The launcher will start
|
||||
* new worker.
|
||||
@ -1292,7 +1307,6 @@ reread_subscription(void)
|
||||
|
||||
/* Check for other changes that should never happen too. */
|
||||
if (newsub->dbid != MySubscription->dbid ||
|
||||
strcmp(newsub->name, MySubscription->name) != 0 ||
|
||||
strcmp(newsub->slotname, MySubscription->slotname) != 0)
|
||||
{
|
||||
elog(ERROR, "subscription %u changed unexpectedly",
|
||||
|
Reference in New Issue
Block a user