mirror of
https://github.com/postgres/postgres.git
synced 2025-06-01 14:21:49 +03:00
pg_createsubscriber: Message improvements
Objects are typically "in" a database, not "on".
This commit is contained in:
parent
b5006abcdc
commit
6622da8d3c
@ -1054,7 +1054,7 @@ drop_existing_subscriptions(PGconn *conn, const char *subname, const char *dbnam
|
|||||||
subname);
|
subname);
|
||||||
appendPQExpBuffer(query, " DROP SUBSCRIPTION %s;", subname);
|
appendPQExpBuffer(query, " DROP SUBSCRIPTION %s;", subname);
|
||||||
|
|
||||||
pg_log_info("dropping subscription \"%s\" on database \"%s\"",
|
pg_log_info("dropping subscription \"%s\" in database \"%s\"",
|
||||||
subname, dbname);
|
subname, dbname);
|
||||||
|
|
||||||
if (!dry_run)
|
if (!dry_run)
|
||||||
@ -1299,7 +1299,7 @@ create_logical_replication_slot(PGconn *conn, struct LogicalRepInfo *dbinfo)
|
|||||||
|
|
||||||
Assert(conn != NULL);
|
Assert(conn != NULL);
|
||||||
|
|
||||||
pg_log_info("creating the replication slot \"%s\" on database \"%s\"",
|
pg_log_info("creating the replication slot \"%s\" in database \"%s\"",
|
||||||
slot_name, dbinfo->dbname);
|
slot_name, dbinfo->dbname);
|
||||||
|
|
||||||
slot_name_esc = PQescapeLiteral(conn, slot_name, strlen(slot_name));
|
slot_name_esc = PQescapeLiteral(conn, slot_name, strlen(slot_name));
|
||||||
@ -1317,7 +1317,7 @@ create_logical_replication_slot(PGconn *conn, struct LogicalRepInfo *dbinfo)
|
|||||||
res = PQexec(conn, str->data);
|
res = PQexec(conn, str->data);
|
||||||
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
||||||
{
|
{
|
||||||
pg_log_error("could not create replication slot \"%s\" on database \"%s\": %s",
|
pg_log_error("could not create replication slot \"%s\" in database \"%s\": %s",
|
||||||
slot_name, dbinfo->dbname,
|
slot_name, dbinfo->dbname,
|
||||||
PQresultErrorMessage(res));
|
PQresultErrorMessage(res));
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
@ -1347,7 +1347,7 @@ drop_replication_slot(PGconn *conn, struct LogicalRepInfo *dbinfo,
|
|||||||
|
|
||||||
Assert(conn != NULL);
|
Assert(conn != NULL);
|
||||||
|
|
||||||
pg_log_info("dropping the replication slot \"%s\" on database \"%s\"",
|
pg_log_info("dropping the replication slot \"%s\" in database \"%s\"",
|
||||||
slot_name, dbinfo->dbname);
|
slot_name, dbinfo->dbname);
|
||||||
|
|
||||||
slot_name_esc = PQescapeLiteral(conn, slot_name, strlen(slot_name));
|
slot_name_esc = PQescapeLiteral(conn, slot_name, strlen(slot_name));
|
||||||
@ -1363,7 +1363,7 @@ drop_replication_slot(PGconn *conn, struct LogicalRepInfo *dbinfo,
|
|||||||
res = PQexec(conn, str->data);
|
res = PQexec(conn, str->data);
|
||||||
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
if (PQresultStatus(res) != PGRES_TUPLES_OK)
|
||||||
{
|
{
|
||||||
pg_log_error("could not drop replication slot \"%s\" on database \"%s\": %s",
|
pg_log_error("could not drop replication slot \"%s\" in database \"%s\": %s",
|
||||||
slot_name, dbinfo->dbname, PQresultErrorMessage(res));
|
slot_name, dbinfo->dbname, PQresultErrorMessage(res));
|
||||||
dbinfo->made_replslot = false; /* don't try again. */
|
dbinfo->made_replslot = false; /* don't try again. */
|
||||||
}
|
}
|
||||||
@ -1570,7 +1570,7 @@ create_publication(PGconn *conn, struct LogicalRepInfo *dbinfo)
|
|||||||
PQclear(res);
|
PQclear(res);
|
||||||
resetPQExpBuffer(str);
|
resetPQExpBuffer(str);
|
||||||
|
|
||||||
pg_log_info("creating publication \"%s\" on database \"%s\"",
|
pg_log_info("creating publication \"%s\" in database \"%s\"",
|
||||||
dbinfo->pubname, dbinfo->dbname);
|
dbinfo->pubname, dbinfo->dbname);
|
||||||
|
|
||||||
appendPQExpBuffer(str, "CREATE PUBLICATION %s FOR ALL TABLES",
|
appendPQExpBuffer(str, "CREATE PUBLICATION %s FOR ALL TABLES",
|
||||||
@ -1583,7 +1583,7 @@ create_publication(PGconn *conn, struct LogicalRepInfo *dbinfo)
|
|||||||
res = PQexec(conn, str->data);
|
res = PQexec(conn, str->data);
|
||||||
if (PQresultStatus(res) != PGRES_COMMAND_OK)
|
if (PQresultStatus(res) != PGRES_COMMAND_OK)
|
||||||
{
|
{
|
||||||
pg_log_error("could not create publication \"%s\" on database \"%s\": %s",
|
pg_log_error("could not create publication \"%s\" in database \"%s\": %s",
|
||||||
dbinfo->pubname, dbinfo->dbname, PQresultErrorMessage(res));
|
dbinfo->pubname, dbinfo->dbname, PQresultErrorMessage(res));
|
||||||
disconnect_database(conn, true);
|
disconnect_database(conn, true);
|
||||||
}
|
}
|
||||||
@ -1612,7 +1612,7 @@ drop_publication(PGconn *conn, struct LogicalRepInfo *dbinfo)
|
|||||||
|
|
||||||
pubname_esc = PQescapeIdentifier(conn, dbinfo->pubname, strlen(dbinfo->pubname));
|
pubname_esc = PQescapeIdentifier(conn, dbinfo->pubname, strlen(dbinfo->pubname));
|
||||||
|
|
||||||
pg_log_info("dropping publication \"%s\" on database \"%s\"",
|
pg_log_info("dropping publication \"%s\" in database \"%s\"",
|
||||||
dbinfo->pubname, dbinfo->dbname);
|
dbinfo->pubname, dbinfo->dbname);
|
||||||
|
|
||||||
appendPQExpBuffer(str, "DROP PUBLICATION %s", pubname_esc);
|
appendPQExpBuffer(str, "DROP PUBLICATION %s", pubname_esc);
|
||||||
@ -1626,7 +1626,7 @@ drop_publication(PGconn *conn, struct LogicalRepInfo *dbinfo)
|
|||||||
res = PQexec(conn, str->data);
|
res = PQexec(conn, str->data);
|
||||||
if (PQresultStatus(res) != PGRES_COMMAND_OK)
|
if (PQresultStatus(res) != PGRES_COMMAND_OK)
|
||||||
{
|
{
|
||||||
pg_log_error("could not drop publication \"%s\" on database \"%s\": %s",
|
pg_log_error("could not drop publication \"%s\" in database \"%s\": %s",
|
||||||
dbinfo->pubname, dbinfo->dbname, PQresultErrorMessage(res));
|
dbinfo->pubname, dbinfo->dbname, PQresultErrorMessage(res));
|
||||||
dbinfo->made_publication = false; /* don't try again. */
|
dbinfo->made_publication = false; /* don't try again. */
|
||||||
|
|
||||||
@ -1672,7 +1672,7 @@ create_subscription(PGconn *conn, const struct LogicalRepInfo *dbinfo)
|
|||||||
pubconninfo_esc = PQescapeLiteral(conn, dbinfo->pubconninfo, strlen(dbinfo->pubconninfo));
|
pubconninfo_esc = PQescapeLiteral(conn, dbinfo->pubconninfo, strlen(dbinfo->pubconninfo));
|
||||||
replslotname_esc = PQescapeLiteral(conn, dbinfo->replslotname, strlen(dbinfo->replslotname));
|
replslotname_esc = PQescapeLiteral(conn, dbinfo->replslotname, strlen(dbinfo->replslotname));
|
||||||
|
|
||||||
pg_log_info("creating subscription \"%s\" on database \"%s\"",
|
pg_log_info("creating subscription \"%s\" in database \"%s\"",
|
||||||
dbinfo->subname, dbinfo->dbname);
|
dbinfo->subname, dbinfo->dbname);
|
||||||
|
|
||||||
appendPQExpBuffer(str,
|
appendPQExpBuffer(str,
|
||||||
@ -1693,7 +1693,7 @@ create_subscription(PGconn *conn, const struct LogicalRepInfo *dbinfo)
|
|||||||
res = PQexec(conn, str->data);
|
res = PQexec(conn, str->data);
|
||||||
if (PQresultStatus(res) != PGRES_COMMAND_OK)
|
if (PQresultStatus(res) != PGRES_COMMAND_OK)
|
||||||
{
|
{
|
||||||
pg_log_error("could not create subscription \"%s\" on database \"%s\": %s",
|
pg_log_error("could not create subscription \"%s\" in database \"%s\": %s",
|
||||||
dbinfo->subname, dbinfo->dbname, PQresultErrorMessage(res));
|
dbinfo->subname, dbinfo->dbname, PQresultErrorMessage(res));
|
||||||
disconnect_database(conn, true);
|
disconnect_database(conn, true);
|
||||||
}
|
}
|
||||||
@ -1769,7 +1769,7 @@ set_replication_progress(PGconn *conn, const struct LogicalRepInfo *dbinfo, cons
|
|||||||
*/
|
*/
|
||||||
originname = psprintf("pg_%u", suboid);
|
originname = psprintf("pg_%u", suboid);
|
||||||
|
|
||||||
pg_log_info("setting the replication progress (node name \"%s\" ; LSN %s) on database \"%s\"",
|
pg_log_info("setting the replication progress (node name \"%s\" ; LSN %s) in database \"%s\"",
|
||||||
originname, lsnstr, dbinfo->dbname);
|
originname, lsnstr, dbinfo->dbname);
|
||||||
|
|
||||||
resetPQExpBuffer(str);
|
resetPQExpBuffer(str);
|
||||||
@ -1815,7 +1815,7 @@ enable_subscription(PGconn *conn, const struct LogicalRepInfo *dbinfo)
|
|||||||
|
|
||||||
subname = PQescapeIdentifier(conn, dbinfo->subname, strlen(dbinfo->subname));
|
subname = PQescapeIdentifier(conn, dbinfo->subname, strlen(dbinfo->subname));
|
||||||
|
|
||||||
pg_log_info("enabling subscription \"%s\" on database \"%s\"",
|
pg_log_info("enabling subscription \"%s\" in database \"%s\"",
|
||||||
dbinfo->subname, dbinfo->dbname);
|
dbinfo->subname, dbinfo->dbname);
|
||||||
|
|
||||||
appendPQExpBuffer(str, "ALTER SUBSCRIPTION %s ENABLE", subname);
|
appendPQExpBuffer(str, "ALTER SUBSCRIPTION %s ENABLE", subname);
|
||||||
|
@ -414,16 +414,16 @@ $result = $node_s->safe_psql($db1,
|
|||||||
);
|
);
|
||||||
is($result, qq(0), 'failover slot was removed');
|
is($result, qq(0), 'failover slot was removed');
|
||||||
|
|
||||||
# Check result on database $db1
|
# Check result in database $db1
|
||||||
$result = $node_s->safe_psql($db1, 'SELECT * FROM tbl1');
|
$result = $node_s->safe_psql($db1, 'SELECT * FROM tbl1');
|
||||||
is( $result, qq(first row
|
is( $result, qq(first row
|
||||||
second row
|
second row
|
||||||
third row),
|
third row),
|
||||||
"logical replication works on database $db1");
|
"logical replication works in database $db1");
|
||||||
|
|
||||||
# Check result on database $db2
|
# Check result in database $db2
|
||||||
$result = $node_s->safe_psql($db2, 'SELECT * FROM tbl2');
|
$result = $node_s->safe_psql($db2, 'SELECT * FROM tbl2');
|
||||||
is($result, qq(row 1), "logical replication works on database $db2");
|
is($result, qq(row 1), "logical replication works in database $db2");
|
||||||
|
|
||||||
# Different system identifier?
|
# Different system identifier?
|
||||||
my $sysid_p = $node_p->safe_psql('postgres',
|
my $sysid_p = $node_p->safe_psql('postgres',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user