Refresh Publication
Needed to prevent issues with logical replication
This commit is contained in:
@@ -894,6 +894,21 @@ if (!class_exists('schema')) {
|
|||||||
unset ($sql_update, $sql);
|
unset ($sql_update, $sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//refresh each postgresql subscription with its publication
|
||||||
|
if ($db_type == "pgsql") {
|
||||||
|
//get the list of postgresql subscriptions
|
||||||
|
$sql = "select subname from pg_subscription; ";
|
||||||
|
$pg_subscriptions = $this->database->select($sql, null, 'all');
|
||||||
|
unset($sql, $parameters);
|
||||||
|
|
||||||
|
//refresh each subscription publication
|
||||||
|
foreach ($pg_subscriptions as $row) {
|
||||||
|
$sql = "ALTER SUBSCRIPTION ".$row['subname']." REFRESH PUBLICATION;";
|
||||||
|
$response .= $sql;
|
||||||
|
$this->database->execute($sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//handle response
|
//handle response
|
||||||
//if ($output == "echo") {
|
//if ($output == "echo") {
|
||||||
// echo $response;
|
// echo $response;
|
||||||
@@ -914,4 +929,3 @@ if (!class_exists('schema')) {
|
|||||||
//print_r($result_array);
|
//print_r($result_array);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user