--- postgresql-8.2.5.orig/src/bin/pg_dump/pg_backup_archiver.c	2007-08-06 03:38:24.000000000 +0200
+++ postgresql-8.2.5/src/bin/pg_dump/pg_backup_archiver.c	2007-11-16 11:00:46.000000000 +0100
@@ -241,9 +241,6 @@
 			{
 				/* We want the schema */
 				ahlog(AH, 1, "dropping %s %s\n", te->desc, te->tag);
-				/* Select owner and schema as necessary */
-				_becomeOwner(AH, te);
-				_selectOutputSchema(AH, te->namespace);
 				/* Drop it */
 				ahprintf(AH, "%s", te->dropStmt);
 			}
@@ -275,6 +272,10 @@
 		{
 			ahlog(AH, 1, "creating %s %s\n", te->desc, te->tag);
 
+			/* Select owner and schema as necessary */
+			_becomeOwner(AH, te);
+			_selectOutputSchema(AH, te->namespace);
+
 			_printTocEntry(AH, te, ropt, false, false);
 			defnDumped = true;
 
