Content-Length: 275110 | pFad | http://github.com/postgrespro/postgres_cluster/commit/cf557661610e8dc315513bba6363d4fc2e4917d9

70 Show error when user tries to use wrong database · postgrespro/postgres_cluster@cf55766 · GitHub
Skip to content

Commit cf55766

Browse files
committed
Show error when user tries to use wrong database
1 parent af8b8d1 commit cf55766

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

multimaster.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ char const* const MtmTxnStatusMnem[] =
218218
bool MtmDoReplication;
219219
char* MtmDatabaseName;
220220
char* MtmDatabaseUser;
221+
Oid MtmDatabaseId;
221222

222223
int MtmNodes;
223224
int MtmNodeId;
@@ -938,6 +939,12 @@ MtmPrePrepareTransaction(MtmCurrentTrans* x)
938939
bool found;
939940
MTM_TXTRACE(x, "PrePrepareTransaction Start");
940941

942+
if (!MtmDatabaseId)
943+
MtmDatabaseId = get_database_oid(MtmDatabaseName, false);
944+
945+
if (MtmDatabaseId != MyDatabaseId)
946+
MTM_ELOG(ERROR, "Refusing to work. Multimaster configured to work with database '%s'", MtmDatabaseName);
947+
941948
if (!x->isDistributed) {
942949
return;
943950
}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/cf557661610e8dc315513bba6363d4fc2e4917d9

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy