* by PostgreSQL
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.534 2009/04/06 08:42:53 heikki Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.535 2009/04/08 19:02:37 heikki Exp $
*
*-------------------------------------------------------------------------
*/
appendPQExpBuffer(creaQry, "\n-- For binary upgrade, set datfrozenxid.\n");
appendPQExpBuffer(creaQry, "UPDATE pg_database\n"
"SET datfrozenxid = '%u'\n"
- "WHERE datname = '%s';\n",
- frozenxid, datname);
+ "WHERE datname = ",
+ frozenxid);
+ appendStringLiteralAH(creaQry, datname, AH);
+ appendPQExpBuffer(creaQry, ";\n");
}
appendPQExpBuffer(delQry, "DROP DATABASE %s;\n",
appendPQExpBuffer(q, "CREATE SERVER %s", fmtId(srvinfo->dobj.name));
if (srvinfo->srvtype && strlen(srvinfo->srvtype) > 0)
- appendPQExpBuffer(q, " TYPE '%s'", srvinfo->srvtype);
+ {
+ appendPQExpBuffer(q, " TYPE ");
+ appendStringLiteralAH(q, srvinfo->srvtype, fout);
+ }
if (srvinfo->srvversion && strlen(srvinfo->srvversion) > 0)
- appendPQExpBuffer(q, " VERSION '%s'", srvinfo->srvversion);
+ {
+ appendPQExpBuffer(q, " VERSION ");
+ appendStringLiteralAH(q, srvinfo->srvversion, fout);
+ }
appendPQExpBuffer(q, " FOREIGN DATA WRAPPER ");
appendPQExpBuffer(q, "%s", fmtId(fdwname));
" WHERE relnamespace = "
"(SELECT oid FROM pg_namespace "
"WHERE nspname = CURRENT_SCHEMA)\n"
- " AND relname = '%s'\n"
- " );\n",
+ " AND relname = ",
tbinfo->attlen[j],
tbinfo->attalign[j],
- tbinfo->attnames[j],
- tbinfo->dobj.name);
+ tbinfo->attnames[j]);
+ appendStringLiteralAH(q, tbinfo->dobj.name, fout);
+ appendPQExpBuffer(q, "\n );\n");
}
}
appendPQExpBuffer(q, "\n-- For binary upgrade, set relfrozenxid.\n");
appendPQExpBuffer(q, "UPDATE pg_class\n"
"SET relfrozenxid = '%u'\n"
- "WHERE relname = '%s'\n"
- " AND relnamespace = "
+ "WHERE relname = ",
+ tbinfo->frozenxid);
+ appendStringLiteralAH(q, tbinfo->dobj.name, fout);
+ appendPQExpBuffer(q, "\n AND relnamespace = "
"(SELECT oid FROM pg_namespace "
- "WHERE nspname = CURRENT_SCHEMA);\n",
- tbinfo->frozenxid,
- tbinfo->dobj.name);
+ "WHERE nspname = CURRENT_SCHEMA);\n");
}
/* Loop dumping statistics and storage statements */
* Portions Copyright (c) 1994, Regents of the University of California
*
*
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.122 2009/04/06 08:42:53 heikki Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.123 2009/04/08 19:02:37 heikki Exp $
*
*-------------------------------------------------------------------------
*/
appendPQExpBuffer(buf, "\n-- For binary upgrade, set datfrozenxid.\n");
appendPQExpBuffer(buf, "UPDATE pg_database\n"
"SET datfrozenxid = '%u'\n"
- "WHERE datname = '%s';\n",
- dbfrozenxid, fdbname);
+ "WHERE datname = ",
+ dbfrozenxid);
+ appendStringLiteralConn(buf, dbname, conn);
+ appendPQExpBuffer(buf, ";\n");
}
}