pg_dump changes to dump a cluster
Minor modifications are made to pg_dump, to allow the table attributes
and functions to be correctly dumped for a cluster.  These
changes essentially fix a bug, as the pg_dump should be able to
dump a cluster.
@@ -7249,6 +7249,17 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
"ORDER BY conname",
tbinfo->dobj.catId.oid);
}
+ else if (fout->remoteVersion >= 70400)
+ {
+ appendPQExpBuffer(q, "SELECT tableoid, oid, conname, "
+ "pg_catalog.pg_get_constraintdef(oid) AS consrc, "
+ "true AS conislocal, true AS convalidated "
+ "FROM pg_catalog.pg_constraint "
+ "WHERE conrelid = '%u'::pg_catalog.oid "
+ " AND contype = 'c' "
+ "ORDER BY conname",
+ tbinfo->dobj.catId.oid);
+ }
else
{
error_unsupported_server_version(fout);
@@ -10310,7 +10321,7 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
"pg_catalog.pg_get_function_arguments(oid) AS funcargs, "
"pg_catalog.pg_get_function_identity_arguments(oid) AS funciargs, "
"pg_catalog.pg_get_function_result(oid) AS funcresult, "
- "proiswindow, provolatile, proisstrict, prosecdef, "
+ "proiswin as proiswindow, provolatile, proisstrict, prosecdef, "
"false AS proleakproof, "
"proconfig, procost, prorows, prodataaccess, "
"'a' as proexeclocation, "
