|
7 | 7 | * |
8 | 8 | * |
9 | 9 | * IDENTIFICATION |
10 | | - * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.1.1.1 1996/07/09 06:22:14 scrappy Exp $ |
| 10 | + * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.2 1996/07/12 05:39:33 scrappy Exp $ |
11 | 11 | * |
12 | 12 | *------------------------------------------------------------------------- |
13 | 13 | */ |
@@ -199,7 +199,7 @@ strInArray(char* pattern, char** arr, int arr_size) |
199 | 199 | */ |
200 | 200 |
|
201 | 201 | TableInfo* |
202 | | -dumpSchema(FILE*fout,int*numTablesPtr) |
| 202 | +dumpSchema(FILE*fout,int*numTablesPtr,char*tablename) |
203 | 203 | { |
204 | 204 | intnumTypes; |
205 | 205 | intnumFuncs; |
@@ -252,31 +252,42 @@ if (g_verbose) fprintf(stderr,"%s reading indices information %s\n", |
252 | 252 | g_comment_start,g_comment_end); |
253 | 253 | indinfo=getIndices(&numIndices); |
254 | 254 |
|
255 | | -if (g_verbose)fprintf(stderr,"%s dumping out user-defined types %s\n", |
256 | | -g_comment_start,g_comment_end); |
257 | | -dumpTypes(fout,finfo,numFuncs,tinfo,numTypes); |
| 255 | +if (!tablename&&fout) { |
| 256 | +if (g_verbose)fprintf(stderr,"%s dumping out user-defined types %s\n", |
| 257 | +g_comment_start,g_comment_end); |
| 258 | +dumpTypes(fout,finfo,numFuncs,tinfo,numTypes); |
| 259 | +} |
258 | 260 |
|
259 | | -if (g_verbose)fprintf(stderr,"%s dumping out tables %s\n", |
| 261 | +if (fout) { |
| 262 | +if (g_verbose)fprintf(stderr,"%s dumping out tables %s\n", |
260 | 263 | g_comment_start,g_comment_end); |
261 | 264 | dumpTables(fout,tblinfo,numTables,inhinfo,numInherits, |
262 | | -tinfo,numTypes); |
| 265 | +tinfo,numTypes,tablename); |
| 266 | +} |
263 | 267 |
|
264 | | -if (g_verbose)fprintf(stderr,"%s dumping out user-defined functions %s\n", |
265 | | -g_comment_start,g_comment_end); |
266 | | -dumpFuncs(fout,finfo,numFuncs,tinfo,numTypes); |
| 268 | +if (!tablename&&fout) { |
| 269 | +if (g_verbose)fprintf(stderr,"%s dumping out user-defined functions %s\n", |
| 270 | +g_comment_start,g_comment_end); |
| 271 | +dumpFuncs(fout,finfo,numFuncs,tinfo,numTypes); |
| 272 | +} |
267 | 273 |
|
268 | | -if (g_verbose)fprintf(stderr,"%s dumping out user-defined functions %s\n", |
269 | | -g_comment_start,g_comment_end); |
270 | | -dumpAggs(fout,agginfo,numAggregates,tinfo,numTypes); |
| 274 | +if (!tablename&&fout) { |
| 275 | +if (g_verbose)fprintf(stderr,"%s dumping out user-defined functions %s\n", |
| 276 | +g_comment_start,g_comment_end); |
| 277 | +dumpAggs(fout,agginfo,numAggregates,tinfo,numTypes); |
| 278 | +} |
271 | 279 |
|
272 | | -if (g_verbose)fprintf(stderr,"%s dumping out user-defined operators %s\n", |
273 | | -g_comment_start,g_comment_end); |
274 | | -dumpOprs(fout,oprinfo,numOperators,tinfo,numTypes); |
275 | | - |
276 | | -if (g_verbose)fprintf(stderr,"%s dumping out indices %s\n", |
277 | | -g_comment_start,g_comment_end); |
278 | | -dumpIndices(fout,indinfo,numIndices,tblinfo,numTables); |
| 280 | +if (!tablename&&fout) { |
| 281 | +if (g_verbose)fprintf(stderr,"%s dumping out user-defined operators %s\n", |
| 282 | +g_comment_start,g_comment_end); |
| 283 | +dumpOprs(fout,oprinfo,numOperators,tinfo,numTypes); |
| 284 | +} |
279 | 285 |
|
| 286 | +if (fout) { |
| 287 | +if (g_verbose)fprintf(stderr,"%s dumping out indices %s\n", |
| 288 | +g_comment_start,g_comment_end); |
| 289 | +dumpIndices(fout,indinfo,numIndices,tblinfo,numTables,tablename); |
| 290 | +} |
280 | 291 | *numTablesPtr=numTables; |
281 | 292 | returntblinfo; |
282 | 293 | } |
|