88 *
99 *
1010 * IDENTIFICATION
11- * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.48 2000/12/03 20:45:37 tgl Exp $
11+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.49 2001/01/12 15:41:29 pjw Exp $
1212 *
1313 * Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
1414 *
@@ -270,12 +270,14 @@ dumpSchema(Archive *fout,
270270 int numInherits ;
271271 int numAggregates ;
272272 int numOperators ;
273+ int numIndices ;
273274 TypeInfo * tinfo = NULL ;
274275 FuncInfo * finfo = NULL ;
275276 AggInfo * agginfo = NULL ;
276277 TableInfo * tblinfo = NULL ;
277278 InhInfo * inhinfo = NULL ;
278279 OprInfo * oprinfo = NULL ;
280+ IndInfo * indinfo = NULL ;
279281
280282 if (g_verbose )
281283 fprintf (stderr , "%s reading user-defined types %s\n" ,
@@ -302,6 +304,11 @@ dumpSchema(Archive *fout,
302304 g_comment_start , g_comment_end );
303305 tblinfo = getTables (& numTables , finfo , numFuncs );
304306
307+ if (g_verbose )
308+ fprintf (stderr , "%s reading indices information %s\n" ,
309+ g_comment_start , g_comment_end );
310+ indinfo = getIndices (& numIndices );
311+
305312 if (g_verbose )
306313 fprintf (stderr , "%s reading table inheritance information %s\n" ,
307314 g_comment_start , g_comment_end );
@@ -336,9 +343,18 @@ dumpSchema(Archive *fout,
336343 if (g_verbose )
337344 fprintf (stderr , "%s dumping out tables %s\n" ,
338345 g_comment_start , g_comment_end );
339- dumpTables (fout , tblinfo , numTables , inhinfo , numInherits ,
346+
347+ dumpTables (fout , tblinfo , numTables , indinfo , numIndices , inhinfo , numInherits ,
340348 tinfo , numTypes , tablename , aclsSkip , oids , schemaOnly , dataOnly );
341349
350+ if (fout && !dataOnly )
351+ {
352+ if (g_verbose )
353+ fprintf (stderr , "%s dumping out indices %s\n" ,
354+ g_comment_start , g_comment_end );
355+ dumpIndices (fout , indinfo , numIndices , tblinfo , numTables , tablename );
356+ }
357+
342358 if (!tablename && !dataOnly )
343359 {
344360 if (g_verbose )
@@ -377,35 +393,8 @@ dumpSchema(Archive *fout,
377393 clearTypeInfo (tinfo , numTypes );
378394 clearFuncInfo (finfo , numFuncs );
379395 clearInhInfo (inhinfo , numInherits );
380- return tblinfo ;
381- }
382-
383- /*
384- * dumpSchemaIdx:
385- * dump indexes at the end for performance
386- *
387- */
388-
389- extern void
390- dumpSchemaIdx (Archive * fout , const char * tablename ,
391- TableInfo * tblinfo , int numTables )
392- {
393- int numIndices ;
394- IndInfo * indinfo ;
395-
396- if (g_verbose )
397- fprintf (stderr , "%s reading indices information %s\n" ,
398- g_comment_start , g_comment_end );
399- indinfo = getIndices (& numIndices );
400-
401- if (fout )
402- {
403- if (g_verbose )
404- fprintf (stderr , "%s dumping out indices %s\n" ,
405- g_comment_start , g_comment_end );
406- dumpIndices (fout , indinfo , numIndices , tblinfo , numTables , tablename );
407- }
408396 clearIndInfo (indinfo , numIndices );
397+ return tblinfo ;
409398}
410399
411400/* flagInhAttrs -
0 commit comments