|
15 | 15 | *
|
16 | 16 | *
|
17 | 17 | * IDENTIFICATION
|
18 |
| - *$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.149 2007/11/15 21:14:41 momjian Exp $ |
| 18 | + *$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.150 2007/11/24 17:45:32 momjian Exp $ |
19 | 19 | *
|
20 | 20 | *-------------------------------------------------------------------------
|
21 | 21 | */
|
@@ -245,6 +245,21 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
|
245 | 245 | _selectOutputSchema(AH,te->namespace);
|
246 | 246 | /* Drop it */
|
247 | 247 | ahprintf(AH,"%s",te->dropStmt);
|
| 248 | +if (strcmp(te->desc,"SCHEMA")==0) |
| 249 | +{ |
| 250 | +/* |
| 251 | + * If we dropped a schema, we know we are going to be |
| 252 | + * creating one later so don't remember the current one |
| 253 | + * so we try later. The previous 'search_path' setting |
| 254 | + * might have failed because the schema didn't exist |
| 255 | + * (and now it certainly doesn't exist), so force |
| 256 | + * search_path to be set as part of the next operation |
| 257 | + * and it might succeed. |
| 258 | + */ |
| 259 | +if (AH->currSchema) |
| 260 | +free(AH->currSchema); |
| 261 | +AH->currSchema=strdup(""); |
| 262 | +} |
248 | 263 | }
|
249 | 264 | }
|
250 | 265 | }
|
|