8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.56 2001/06/27 21 :21:36 petere Exp $
11
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.57 2001/07/03 20 :21:47 petere Exp $
12
12
*
13
13
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
14
14
*
@@ -179,7 +179,7 @@ findParentsByOid(TableInfo *tblinfo, int numTables,
179
179
inhinfo [i ].inhparent ,
180
180
oid );
181
181
182
- exit ( 2 );
182
+ exit_nicely ( );
183
183
}
184
184
(* * parentIndexes )[j ] = parentInd ;
185
185
result [j ++ ] = tblinfo [parentInd ].relname ;
@@ -219,7 +219,7 @@ parseNumericArray(const char *str, char **array, int arraysize)
219
219
if (argNum >= arraysize )
220
220
{
221
221
write_msg (NULL , "parseNumericArray: too many numbers\n" );
222
- exit ( 2 );
222
+ exit_nicely ( );
223
223
}
224
224
temp [j ] = '\0' ;
225
225
array [argNum ++ ] = strdup (temp );
@@ -234,7 +234,7 @@ parseNumericArray(const char *str, char **array, int arraysize)
234
234
j >= sizeof (temp ) - 1 )
235
235
{
236
236
write_msg (NULL , "parseNumericArray: bogus number\n" );
237
- exit ( 2 );
237
+ exit_nicely ( );
238
238
}
239
239
temp [j ++ ] = s ;
240
240
}
@@ -297,110 +297,93 @@ dumpSchema(Archive *fout,
297
297
IndInfo * indinfo = NULL ;
298
298
299
299
if (g_verbose )
300
- fprintf (stderr , "%s reading user-defined types %s\n" ,
301
- g_comment_start , g_comment_end );
300
+ write_msg (NULL , "reading user-defined types\n" );
302
301
tinfo = getTypes (& numTypes );
303
302
304
303
if (g_verbose )
305
- fprintf (stderr , "%s reading user-defined functions %s\n" ,
306
- g_comment_start , g_comment_end );
304
+ write_msg (NULL , "reading user-defined functions\n" );
307
305
finfo = getFuncs (& numFuncs );
308
306
309
307
if (g_verbose )
310
- fprintf (stderr , "%s reading user-defined aggregates %s\n" ,
311
- g_comment_start , g_comment_end );
308
+ write_msg (NULL , "reading user-defined aggregate functions\n" );
312
309
agginfo = getAggregates (& numAggregates );
313
310
314
311
if (g_verbose )
315
- fprintf (stderr , "%s reading user-defined operators %s\n" ,
316
- g_comment_start , g_comment_end );
312
+ write_msg (NULL , "reading user-defined operators\n" );
317
313
oprinfo = getOperators (& numOperators );
318
314
319
315
if (g_verbose )
320
- fprintf (stderr , "%s reading user-defined tables %s\n" ,
321
- g_comment_start , g_comment_end );
316
+ write_msg (NULL , "reading user-defined tables\n" );
322
317
tblinfo = getTables (& numTables , finfo , numFuncs );
323
318
324
319
if (g_verbose )
325
- fprintf (stderr , "%s reading indexes information %s\n" ,
326
- g_comment_start , g_comment_end );
320
+ write_msg (NULL , "reading index information\n" );
327
321
indinfo = getIndexes (& numIndexes );
328
322
329
323
if (g_verbose )
330
- fprintf (stderr , "%s reading table inheritance information %s\n" ,
331
- g_comment_start , g_comment_end );
324
+ write_msg (NULL , "reading table inheritance information\n" );
332
325
inhinfo = getInherits (& numInherits );
333
326
334
327
if (g_verbose )
335
- fprintf (stderr , "%s finding the attribute names and types for each table %s\n" ,
336
- g_comment_start , g_comment_end );
328
+ write_msg (NULL , "finding the column names and types for each table\n" );
337
329
getTableAttrs (tblinfo , numTables );
338
330
339
331
if (g_verbose )
340
- fprintf (stderr , "%s flagging inherited attributes in subtables %s\n" ,
341
- g_comment_start , g_comment_end );
332
+ write_msg (NULL , "flagging inherited columns in subtables\n" );
342
333
flagInhAttrs (tblinfo , numTables , inhinfo , numInherits );
343
334
344
335
if (!tablename && !dataOnly )
345
336
{
346
337
if (g_verbose )
347
- fprintf (stderr , "%s dumping out database comment %s\n" ,
348
- g_comment_start , g_comment_end );
338
+ write_msg (NULL , "dumping out database comment\n" );
349
339
dumpDBComment (fout );
350
340
}
351
341
352
342
if (!tablename && fout )
353
343
{
354
344
if (g_verbose )
355
- fprintf (stderr , "%s dumping out user-defined types %s\n" ,
356
- g_comment_start , g_comment_end );
345
+ write_msg (NULL , "dumping out user-defined types\n" );
357
346
dumpTypes (fout , finfo , numFuncs , tinfo , numTypes );
358
347
}
359
348
360
349
if (g_verbose )
361
- fprintf (stderr , "%s dumping out tables %s\n" ,
362
- g_comment_start , g_comment_end );
350
+ write_msg (NULL , "dumping out tables\n" );
363
351
364
352
dumpTables (fout , tblinfo , numTables , indinfo , numIndexes , inhinfo , numInherits ,
365
353
tinfo , numTypes , tablename , aclsSkip , oids , schemaOnly , dataOnly );
366
354
367
355
if (fout && !dataOnly )
368
356
{
369
357
if (g_verbose )
370
- fprintf (stderr , "%s dumping out indexes %s\n" ,
371
- g_comment_start , g_comment_end );
358
+ write_msg (NULL , "dumping out indexes\n" );
372
359
dumpIndexes (fout , indinfo , numIndexes , tblinfo , numTables , tablename );
373
360
}
374
361
375
362
if (!tablename && !dataOnly )
376
363
{
377
364
if (g_verbose )
378
- fprintf (stderr , "%s dumping out user-defined procedural languages %s\n" ,
379
- g_comment_start , g_comment_end );
365
+ write_msg (NULL , "dumping out user-defined procedural languages\n" );
380
366
dumpProcLangs (fout , finfo , numFuncs , tinfo , numTypes );
381
367
}
382
368
383
369
if (!tablename && !dataOnly )
384
370
{
385
371
if (g_verbose )
386
- fprintf (stderr , "%s dumping out user-defined functions %s\n" ,
387
- g_comment_start , g_comment_end );
372
+ write_msg (NULL , "dumping out user-defined functions\n" );
388
373
dumpFuncs (fout , finfo , numFuncs , tinfo , numTypes );
389
374
}
390
375
391
376
if (!tablename && !dataOnly )
392
377
{
393
378
if (g_verbose )
394
- fprintf (stderr , "%s dumping out user-defined aggregates %s\n" ,
395
- g_comment_start , g_comment_end );
379
+ write_msg (NULL , "dumping out user-defined aggregate functions\n" );
396
380
dumpAggs (fout , agginfo , numAggregates , tinfo , numTypes );
397
381
}
398
382
399
383
if (!tablename && !dataOnly )
400
384
{
401
385
if (g_verbose )
402
- fprintf (stderr , "%s dumping out user-defined operators %s\n" ,
403
- g_comment_start , g_comment_end );
386
+ write_msg (NULL , "dumping out user-defined operators\n" );
404
387
dumpOprs (fout , oprinfo , numOperators , tinfo , numTypes );
405
388
}
406
389
@@ -490,7 +473,7 @@ flagInhAttrs(TableInfo *tblinfo, int numTables,
490
473
/* shouldn't happen unless findParentsByOid is broken */
491
474
write_msg (NULL , "failed sanity check, table \"%s\" not found by flagInhAttrs\n" ,
492
475
tblinfo [i ].parentRels [k ]);
493
- exit ( 2 );
476
+ exit_nicely ( );
494
477
};
495
478
496
479
inhAttrInd = strInArray (tblinfo [i ].attnames [j ],
0 commit comments