mirror of
https://github.com/postgres/postgres.git
synced 2025-05-03 22:24:49 +03:00
pg_dump: Fix dumping of slot_name = NONE
It previously wrote out slot_name = '', which was incorrect. Reported-by: Masahiko Sawada <sawada.mshk@gmail.com>
This commit is contained in:
parent
6234569851
commit
157239d2cd
@ -3763,6 +3763,9 @@ getSubscriptions(Archive *fout)
|
|||||||
subinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_subname));
|
subinfo[i].dobj.name = pg_strdup(PQgetvalue(res, i, i_subname));
|
||||||
subinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname));
|
subinfo[i].rolname = pg_strdup(PQgetvalue(res, i, i_rolname));
|
||||||
subinfo[i].subconninfo = pg_strdup(PQgetvalue(res, i, i_subconninfo));
|
subinfo[i].subconninfo = pg_strdup(PQgetvalue(res, i, i_subconninfo));
|
||||||
|
if (PQgetisnull(res, i, i_subslotname))
|
||||||
|
subinfo[i].subslotname = NULL;
|
||||||
|
else
|
||||||
subinfo[i].subslotname = pg_strdup(PQgetvalue(res, i, i_subslotname));
|
subinfo[i].subslotname = pg_strdup(PQgetvalue(res, i, i_subslotname));
|
||||||
subinfo[i].subsynccommit =
|
subinfo[i].subsynccommit =
|
||||||
pg_strdup(PQgetvalue(res, i, i_subsynccommit));
|
pg_strdup(PQgetvalue(res, i, i_subsynccommit));
|
||||||
@ -3831,7 +3834,10 @@ dumpSubscription(Archive *fout, SubscriptionInfo *subinfo)
|
|||||||
}
|
}
|
||||||
|
|
||||||
appendPQExpBuffer(query, " PUBLICATION %s WITH (connect = false, slot_name = ", publications->data);
|
appendPQExpBuffer(query, " PUBLICATION %s WITH (connect = false, slot_name = ", publications->data);
|
||||||
|
if (subinfo->subslotname)
|
||||||
appendStringLiteralAH(query, subinfo->subslotname, fout);
|
appendStringLiteralAH(query, subinfo->subslotname, fout);
|
||||||
|
else
|
||||||
|
appendPQExpBufferStr(query, "NONE");
|
||||||
|
|
||||||
if (strcmp(subinfo->subsynccommit, "off") != 0)
|
if (strcmp(subinfo->subsynccommit, "off") != 0)
|
||||||
appendPQExpBuffer(query, ", synchronous_commit = %s", fmtId(subinfo->subsynccommit));
|
appendPQExpBuffer(query, ", synchronous_commit = %s", fmtId(subinfo->subsynccommit));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user