diff options
author | Marc G. Fournier <scrappy@hub.org> | 1996-08-24 20:49:41 +0000 |
---|---|---|
committer | Marc G. Fournier <scrappy@hub.org> | 1996-08-24 20:49:41 +0000 |
commit | 208a30f23db0926604a338eda4ed69b5c278d2e2 (patch) | |
tree | a6b31fe54d006b5402d5dc6a3ee21dd573442116 /src/bin/pg_dump/common.c | |
parent | 2adb6d703bd255f531fc8e33c9d6abd8d6236a0b (diff) | |
download | postgresql-208a30f23db0926604a338eda4ed69b5c278d2e2.tar.gz |
The patch does several things:
It adds a WITH OIDS option to the copy command, which allows
dumping and loading of oids.
If a copy command tried to load in an oid that is greater than
its current system max oid, the system max oid is incremented. No
checking is done to see if other backends are running and have cached
oids.
pg_dump as its first step when using the -o (oid) option, will
copy in a dummy row to set the system max oid value so as rows are
loaded in, they are certain to be lower than the system oid.
pg_dump now creates indexes at the end to speed loading
Submitted by: Bruce Momjian <maillist@candle.pha.pa.us>
Diffstat (limited to 'src/bin/pg_dump/common.c')
-rw-r--r-- | src/bin/pg_dump/common.c | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c index bcc84f21f7..1e2ac00e61 100644 --- a/src/bin/pg_dump/common.c +++ b/src/bin/pg_dump/common.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.3 1996/07/22 08:36:59 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.4 1996/08/24 20:49:17 scrappy Exp $ * * Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2 * @@ -210,7 +210,6 @@ dumpSchema(FILE *fout, int *numTablesPtr, char *tablename) int numFuncs; int numTables; int numInherits; - int numIndices; int numAggregates; int numOperators; TypeInfo *tinfo; @@ -218,7 +217,6 @@ dumpSchema(FILE *fout, int *numTablesPtr, char *tablename) AggInfo *agginfo; TableInfo *tblinfo; InhInfo *inhinfo; - IndInfo *indinfo; OprInfo *oprinfo; if (g_verbose) fprintf(stderr,"%s reading user-defined types %s\n", @@ -253,10 +251,6 @@ if (g_verbose) fprintf(stderr, "%s flagging inherited attributes in subtables %s g_comment_start, g_comment_end); flagInhAttrs(tblinfo, numTables, inhinfo, numInherits); -if (g_verbose) fprintf(stderr,"%s reading indices information %s\n", - g_comment_start, g_comment_end); - indinfo = getIndices(&numIndices); - if (!tablename && fout) { if (g_verbose) fprintf(stderr,"%s dumping out user-defined types %s\n", g_comment_start, g_comment_end); @@ -288,16 +282,35 @@ if (!tablename && fout) { dumpOprs(fout, oprinfo, numOperators, tinfo, numTypes); } -if (fout) { - if (g_verbose) fprintf(stderr,"%s dumping out indices %s\n", - g_comment_start, g_comment_end); - dumpIndices(fout, indinfo, numIndices, tblinfo, numTables, tablename); -} *numTablesPtr = numTables; return tblinfo; } +/* + * dumpSchemaIdx: + * dump indexes at the end for performance + * + */ + +extern void +dumpSchemaIdx(FILE *fout, int *numTablesPtr, char *tablename, + TableInfo* tblinfo, int numTables) +{ + int numIndices; + IndInfo *indinfo; + + if (g_verbose) fprintf(stderr,"%s reading indices information %s\n", + g_comment_start, g_comment_end); + indinfo = getIndices(&numIndices); + + if (fout) { + if (g_verbose) fprintf(stderr,"%s dumping out indices %s\n", + g_comment_start, g_comment_end); + dumpIndices(fout, indinfo, numIndices, tblinfo, numTables, tablename); + } +} + /* flagInhAttrs - * for each table in tblinfo, flag its inherited attributes * so when we dump the table out, we don't dump out the inherited attributes |