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,
270270int numInherits ;
271271int numAggregates ;
272272int numOperators ;
273+ int numIndices ;
273274TypeInfo * tinfo = NULL ;
274275FuncInfo * finfo = NULL ;
275276AggInfo * agginfo = NULL ;
276277TableInfo * tblinfo = NULL ;
277278InhInfo * inhinfo = NULL ;
278279OprInfo * oprinfo = NULL ;
280+ IndInfo * indinfo = NULL ;
279281
280282if (g_verbose )
281283fprintf (stderr ,"%s reading user-defined types %s\n" ,
@@ -302,6 +304,11 @@ dumpSchema(Archive *fout,
302304g_comment_start ,g_comment_end );
303305tblinfo = 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+
305312if (g_verbose )
306313fprintf (stderr ,"%s reading table inheritance information %s\n" ,
307314g_comment_start ,g_comment_end );
@@ -336,9 +343,18 @@ dumpSchema(Archive *fout,
336343if (g_verbose )
337344fprintf (stderr ,"%s dumping out tables %s\n" ,
338345g_comment_start ,g_comment_end );
339- dumpTables (fout ,tblinfo ,numTables ,inhinfo ,numInherits ,
346+
347+ dumpTables (fout ,tblinfo ,numTables ,indinfo ,numIndices ,inhinfo ,numInherits ,
340348tinfo ,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+
342358if (!tablename && !dataOnly )
343359{
344360if (g_verbose )
@@ -377,35 +393,8 @@ dumpSchema(Archive *fout,
377393clearTypeInfo (tinfo ,numTypes );
378394clearFuncInfo (finfo ,numFuncs );
379395clearInhInfo (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- }
408396clearIndInfo (indinfo ,numIndices );
397+ return tblinfo ;
409398}
410399
411400/* flagInhAttrs -