Remove hard-coded "\connect postgres" from pg_dumpall.
authorRobert Haas <rhaas@postgresql.org>
Fri, 28 Oct 2011 19:45:28 +0000 (15:45 -0400)
committerRobert Haas <rhaas@postgresql.org>
Fri, 28 Oct 2011 19:50:42 +0000 (15:50 -0400)
This doesn't appear to accompish anything useful, and does make the
restore fail if the postgres database happens to have been dropped.

src/bin/pg_dump/pg_dumpall.c

index 0022d2d74ef9146112710e59d916d3a7aa15230b..d138da568ea06e6e2678ae5eab707a01fc8e2578 100644 (file)
@@ -441,7 +441,12 @@ main(int argc, char *argv[])
        if (verbose)
                dumpTimestamp("Started on");
 
-       fprintf(OPF, "\\connect postgres\n\n");
+       /*
+        * We used to emit \connect postgres here, but that served no purpose
+        * other than to break things for installations without a postgres
+        * database.  Everything we're restoring here is a global, so whichever
+        * database we're connected to at the moment is fine.
+        */
 
        /* Replicate encoding and std_strings in output */
        fprintf(OPF, "SET client_encoding = '%s';\n",