*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.67 2003/02/01 22:06:59 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.68 2003/02/14 19:40:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
sav = SetOutput(AH, ropt->filename, ropt->compression);
ahprintf(AH, "--\n-- PostgreSQL database dump\n--\n\n");
-
+ ahprintf(AH, "SET autocommit TO 'on';\n\n");
+
/*
* Drop the items at the start, in reverse order
*/
dbname ? fmtId(dbname) : "-");
appendPQExpBuffer(qry, " %s\n\n",
fmtId(user));
-
+ appendPQExpBuffer(qry, "SET autocommit TO 'on';\n\n");
+
ahprintf(AH, qry->data);
destroyPQExpBuffer(qry);
* Implements the basic DB functions used by the archiver.
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.45 2003/02/13 04:54:15 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.46 2003/02/14 19:40:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
if (password)
free(password);
+ /* check for version mismatch */
+ _check_database_version(AH, true);
+
+ /* Turn autocommit on */
+ if (AH->public.remoteVersion >= 70300)
+ {
+ PGresult *res;
+
+ res = PQexec(AH->connection, "SET autocommit TO 'on'");
+ if (!res || PQresultStatus(res) != PGRES_COMMAND_OK)
+ die_horribly(AH, NULL, "SET autocommit TO 'on' failed: %s",
+ PQerrorMessage(AH->connection));
+ PQclear(res);
+ }
+
PQsetNoticeProcessor(newConn, notice_processor, NULL);
return newConn;
* Portions Copyright (c) 1994, Regents of the University of California
*
*
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.13 2003/01/16 15:27:59 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.14 2003/02/14 19:40:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
printf("-- PostgreSQL database cluster dump\n");
printf("--\n\n");
printf("\\connect \"template1\"\n\n");
+ printf("SET autocommit TO 'on';\n\n");
dumpUsers(conn);
dumpGroups(conn);
fprintf(stderr, _("%s: dumping database \"%s\"...\n"), progname, dbname);
printf("\\connect %s\n", fmtId(dbname));
+ printf("SET autocommit TO 'on';\n\n");
ret = runPgDump(dbname);
if (ret != 0)
{
}
PQclear(res);
+ if (server_version >= 70300)
+ {
+ PGresult *res;
+
+ res = executeQuery(conn, "SET autocommit TO 'on';SELECT 1;");
+ PQclear(res);
+ }
+
return conn;
}