Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc704042

Browse files
committed
Fix obviously-utterly-untested noTocComments code.
1 parent64cb889 commitc704042

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

‎src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*
1717
* IDENTIFICATION
18-
*$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.95 2004/08/29 05:06:53 momjian Exp $
18+
*$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.96 2004/08/30 19:44:14 tgl Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -2357,8 +2357,6 @@ _getObjectFromDropStmt(const char *dropStmt, const char *type)
23572357
staticvoid
23582358
_printTocEntry(ArchiveHandle*AH,TocEntry*te,RestoreOptions*ropt,boolisData,boolacl_pass)
23592359
{
2360-
constchar*pfx;
2361-
23622360
/* ACLs are dumped only during acl pass */
23632361
if (acl_pass)
23642362
{
@@ -2371,9 +2369,6 @@ _printTocEntry(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt, bool isDat
23712369
return;
23722370
}
23732371

2374-
if (AH->noTocComments)
2375-
return;
2376-
23772372
/*
23782373
* Avoid dumping the public schema, as it will already be created ...
23792374
* unless we are using --clean mode, in which case it's been deleted
@@ -2392,33 +2387,38 @@ _printTocEntry(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt, bool isDat
23922387
_setWithOids(AH,te);
23932388

23942389
/* Emit header comment for item */
2395-
if (isData)
2396-
pfx="Data for ";
2397-
else
2398-
pfx="";
2399-
2400-
ahprintf(AH,"--\n");
2401-
if (AH->public.verbose)
2390+
if (!AH->noTocComments)
24022391
{
2403-
ahprintf(AH,"-- TOC entry %d (class %u OID %u)\n",
2404-
te->dumpId,te->catalogId.tableoid,te->catalogId.oid);
2405-
if (te->nDeps>0)
2392+
constchar*pfx;
2393+
2394+
if (isData)
2395+
pfx="Data for ";
2396+
else
2397+
pfx="";
2398+
2399+
ahprintf(AH,"--\n");
2400+
if (AH->public.verbose)
24062401
{
2407-
inti;
2402+
ahprintf(AH,"-- TOC entry %d (class %u OID %u)\n",
2403+
te->dumpId,te->catalogId.tableoid,te->catalogId.oid);
2404+
if (te->nDeps>0)
2405+
{
2406+
inti;
24082407

2409-
ahprintf(AH,"-- Dependencies:");
2410-
for (i=0;i<te->nDeps;i++)
2411-
ahprintf(AH," %d",te->dependencies[i]);
2412-
ahprintf(AH,"\n");
2408+
ahprintf(AH,"-- Dependencies:");
2409+
for (i=0;i<te->nDeps;i++)
2410+
ahprintf(AH," %d",te->dependencies[i]);
2411+
ahprintf(AH,"\n");
2412+
}
24132413
}
2414+
ahprintf(AH,"-- %sName: %s; Type: %s; Schema: %s; Owner: %s\n",
2415+
pfx,te->tag,te->desc,
2416+
te->namespace ?te->namespace :"-",
2417+
te->owner);
2418+
if (AH->PrintExtraTocPtr!=NULL)
2419+
(*AH->PrintExtraTocPtr) (AH,te);
2420+
ahprintf(AH,"--\n\n");
24142421
}
2415-
ahprintf(AH,"-- %sName: %s; Type: %s; Schema: %s; Owner: %s\n",
2416-
pfx,te->tag,te->desc,
2417-
te->namespace ?te->namespace :"-",
2418-
te->owner);
2419-
if (AH->PrintExtraTocPtr!=NULL)
2420-
(*AH->PrintExtraTocPtr) (AH,te);
2421-
ahprintf(AH,"--\n\n");
24222422

24232423
/*
24242424
* Actually print the definition.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp