diff options
Diffstat (limited to 'src/bin/pg_dump')
| -rw-r--r-- | src/bin/pg_dump/pg_backup_archiver.c | 4 | ||||
| -rw-r--r-- | src/bin/pg_dump/pg_backup_db.c | 39 | ||||
| -rw-r--r-- | src/bin/pg_dump/pg_dumpall.c | 14 |
3 files changed, 5 insertions, 52 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c index df8e09c3d2..9afbdfe07f 100644 --- a/src/bin/pg_dump/pg_backup_archiver.c +++ b/src/bin/pg_dump/pg_backup_archiver.c @@ -15,7 +15,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.71 2003/05/03 22:18:59 tgl Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.72 2003/05/14 03:26:02 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -206,7 +206,6 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt) 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 @@ -2122,7 +2121,6 @@ _reconnectAsUser(ArchiveHandle *AH, const char *dbname, const char *user) dbname ? fmtId(dbname) : "-"); appendPQExpBuffer(qry, " %s\n\n", fmtId(user)); - appendPQExpBuffer(qry, "SET autocommit TO 'on';\n\n"); ahprintf(AH, qry->data); diff --git a/src/bin/pg_dump/pg_backup_db.c b/src/bin/pg_dump/pg_backup_db.c index 60771922e5..a154593863 100644 --- a/src/bin/pg_dump/pg_backup_db.c +++ b/src/bin/pg_dump/pg_backup_db.c @@ -5,7 +5,7 @@ * Implements the basic DB functions used by the archiver. * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.46 2003/02/14 19:40:42 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.47 2003/05/14 03:26:02 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -61,12 +61,7 @@ _check_database_version(ArchiveHandle *AH, bool ignoreVersion) myversion = _parse_version(AH, PG_VERSION); - /* - * Autocommit could be off. We turn it on later but we have to check - * the database version first. - */ - - res = PQexec(conn, "BEGIN;SELECT version();"); + res = PQexec(conn, "SELECT version();"); if (!res || PQresultStatus(res) != PGRES_TUPLES_OK || PQntuples(res) != 1) @@ -77,12 +72,6 @@ _check_database_version(ArchiveHandle *AH, bool ignoreVersion) PQclear(res); - res = PQexec(conn, "COMMIT;"); - if (!res || - PQresultStatus(res) != PGRES_COMMAND_OK) - die_horribly(AH, modulename, "could not get version from server: %s", PQerrorMessage(conn)); - PQclear(res); - AH->public.remoteVersion = remoteversion; if (myversion != remoteversion @@ -216,18 +205,6 @@ _connectDB(ArchiveHandle *AH, const char *reqdb, const char *requser) /* 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; @@ -301,18 +278,6 @@ ConnectDatabase(Archive *AHX, /* check for version mismatch */ _check_database_version(AH, ignoreVersion); - /* 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(AH->connection, notice_processor, NULL); return AH->connection; diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c index f3919048f8..f9db6dfdec 100644 --- a/src/bin/pg_dump/pg_dumpall.c +++ b/src/bin/pg_dump/pg_dumpall.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * - * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.17 2003/04/04 20:42:12 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.18 2003/05/14 03:26:02 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -188,7 +188,6 @@ main(int argc, char *argv[]) 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); @@ -550,8 +549,7 @@ dumpDatabases(PGconn *conn) if (verbose) fprintf(stderr, _("%s: dumping database \"%s\"...\n"), progname, dbname); - printf("\\connect %s\n", fmtId(dbname)); - printf("SET autocommit TO 'on';\n\n"); + printf("\\connect %s\n\n", fmtId(dbname)); ret = runPgDump(dbname); if (ret != 0) { @@ -677,14 +675,6 @@ connectDatabase(const char *dbname, const char *pghost, const char *pgport, } PQclear(res); - if (server_version >= 70300) - { - PGresult *res; - - res = executeQuery(conn, "SET autocommit TO 'on';SELECT 1;"); - PQclear(res); - } - return conn; } |
