Commit a7d417cc authored by Bruce Momjian's avatar Bruce Momjian

Fix problems with pg_dump for iheritance, sequences, archive tables.

parent b6d98355
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.8 1996/12/26 17:46:07 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.9 1997/07/23 17:14:34 momjian Exp $
* *
* NOTES * NOTES
* these routines moved here from commands/define.c and somewhat cleaned up. * these routines moved here from commands/define.c and somewhat cleaned up.
...@@ -237,7 +237,7 @@ OperatorShellMakeWithOpenRelation(Relation pg_operator_desc, ...@@ -237,7 +237,7 @@ OperatorShellMakeWithOpenRelation(Relation pg_operator_desc,
*/ */
i = 0; i = 0;
values[i++] = PointerGetDatum(operatorName); values[i++] = PointerGetDatum(operatorName);
values[i++] = ObjectIdGetDatum(InvalidOid); values[i++] = Int32GetDatum(GetUserId());
values[i++] = (Datum) (uint16) 0; values[i++] = (Datum) (uint16) 0;
values[i++] = (Datum)'b'; /* fill oprkind with a bogus value */ values[i++] = (Datum)'b'; /* fill oprkind with a bogus value */
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.33 1997/06/20 02:20:17 momjian Exp $ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.34 1997/07/23 17:14:59 momjian Exp $
* *
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb * Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
* *
...@@ -738,8 +738,8 @@ getOperators(int *numOprs) ...@@ -738,8 +738,8 @@ getOperators(int *numOprs)
void void
clearTypeInfo(TypeInfo *tp, int numTypes) clearTypeInfo(TypeInfo *tp, int numTypes)
{ {
int i; int i;
for(i=0;i<numTypes;++i) { for(i=0;i<numTypes;++i) {
if(tp[i].oid) free(tp[i].oid); if(tp[i].oid) free(tp[i].oid);
if(tp[i].typowner) free(tp[i].typowner); if(tp[i].typowner) free(tp[i].typowner);
if(tp[i].typname) free(tp[i].typname); if(tp[i].typname) free(tp[i].typname);
...@@ -755,15 +755,15 @@ for(i=0;i<numTypes;++i) { ...@@ -755,15 +755,15 @@ for(i=0;i<numTypes;++i) {
if(tp[i].typrelid) free(tp[i].typrelid); if(tp[i].typrelid) free(tp[i].typrelid);
if(tp[i].usename) free(tp[i].usename); if(tp[i].usename) free(tp[i].usename);
} }
free(tp); free(tp);
} }
void void
clearFuncInfo (FuncInfo *fun, int numFuncs) clearFuncInfo (FuncInfo *fun, int numFuncs)
{ {
int i,a; int i,a;
if(!fun) return; if(!fun) return;
for(i=0;i<numFuncs;++i) { for(i=0;i<numFuncs;++i) {
if(fun[i].oid) free(fun[i].oid); if(fun[i].oid) free(fun[i].oid);
if(fun[i].proname) free(fun[i].proname); if(fun[i].proname) free(fun[i].proname);
if(fun[i].usename) free(fun[i].usename); if(fun[i].usename) free(fun[i].usename);
...@@ -773,19 +773,27 @@ for(i=0;i<numFuncs;++i) { ...@@ -773,19 +773,27 @@ for(i=0;i<numFuncs;++i) {
if(fun[i].prosrc) free(fun[i].prosrc); if(fun[i].prosrc) free(fun[i].prosrc);
if(fun[i].probin) free(fun[i].probin); if(fun[i].probin) free(fun[i].probin);
} }
free(fun); free(fun);
} }
void void
clearTableInfo(TableInfo *tblinfo, int numTables) clearTableInfo(TableInfo *tblinfo, int numTables)
{ {
int i,j; int i,j;
for(i=0;i<numTables;++i) { for(i=0;i<numTables;++i) {
/* skip archive tables */
if (isArchiveName(tblinfo[i].relname))
continue;
if ( tblinfo[i].sequence )
continue;
if(tblinfo[i].oid) free (tblinfo[i].oid); if(tblinfo[i].oid) free (tblinfo[i].oid);
if(tblinfo[i].relname) free (tblinfo[i].relname); if(tblinfo[i].relname) free (tblinfo[i].relname);
if(tblinfo[i].relarch) free (tblinfo[i].relarch); if(tblinfo[i].relarch) free (tblinfo[i].relarch);
if(tblinfo[i].relacl) free (tblinfo[i].relacl); if(tblinfo[i].relacl) free (tblinfo[i].relacl);
for (j=0;j<tblinfo[i].numatts;j++) { for(j=0;j<tblinfo[i].numatts;j++) {
if(tblinfo[i].attnames[j]) free (tblinfo[i].attnames[j]); if(tblinfo[i].attnames[j]) free (tblinfo[i].attnames[j]);
if(tblinfo[i].typnames[j]) free (tblinfo[i].typnames[j]); if(tblinfo[i].typnames[j]) free (tblinfo[i].typnames[j]);
} }
...@@ -795,25 +803,25 @@ for(i=0;i<numTables;++i) { ...@@ -795,25 +803,25 @@ for(i=0;i<numTables;++i) {
if(tblinfo[i].typnames) free (tblinfo[i].typnames); if(tblinfo[i].typnames) free (tblinfo[i].typnames);
if(tblinfo[i].usename) free (tblinfo[i].usename); if(tblinfo[i].usename) free (tblinfo[i].usename);
} }
free(tblinfo); free(tblinfo);
} }
void void
clearInhInfo (InhInfo *inh, int numInherits) { clearInhInfo (InhInfo *inh, int numInherits) {
int i; int i;
if(!inh) return; if(!inh) return;
for(i=0;i<numInherits;++i) { for(i=0;i<numInherits;++i) {
if(inh[i].oid) free(inh[i].oid);
if(inh[i].inhrel) free(inh[i].inhrel); if(inh[i].inhrel) free(inh[i].inhrel);
if(inh[i].inhparent) free(inh[i].inhparent);} if(inh[i].inhparent) free(inh[i].inhparent);
free(inh); }
free(inh);
} }
void void
clearOprInfo(OprInfo *opr, int numOprs){ clearOprInfo(OprInfo *opr, int numOprs){
int i; int i;
if(!opr) return; if(!opr) return;
for(i=0;i<numOprs;++i) { for(i=0;i<numOprs;++i) {
if(opr[i].oid) free(opr[i].oid); if(opr[i].oid) free(opr[i].oid);
if(opr[i].oprname) free(opr[i].oprname); if(opr[i].oprname) free(opr[i].oprname);
if(opr[i].oprkind) free(opr[i].oprkind); if(opr[i].oprkind) free(opr[i].oprkind);
...@@ -829,15 +837,15 @@ for(i=0;i<numOprs;++i) { ...@@ -829,15 +837,15 @@ for(i=0;i<numOprs;++i) {
if(opr[i].oprrsortop) free(opr[i].oprrsortop); if(opr[i].oprrsortop) free(opr[i].oprrsortop);
if(opr[i].usename) free(opr[i].usename); if(opr[i].usename) free(opr[i].usename);
} }
free(opr); free(opr);
} }
void void
clearIndInfo(IndInfo *ind, int numIndices) clearIndInfo(IndInfo *ind, int numIndices)
{ {
int i,a; int i,a;
if(!ind) return; if(!ind) return;
for(i=0;i<numIndices;++i) { for(i=0;i<numIndices;++i) {
if(ind[i].indexrelname) free(ind[i].indexrelname); if(ind[i].indexrelname) free(ind[i].indexrelname);
if(ind[i].indrelname) free(ind[i].indrelname); if(ind[i].indrelname) free(ind[i].indrelname);
if(ind[i].indamname) free(ind[i].indamname); if(ind[i].indamname) free(ind[i].indamname);
...@@ -845,17 +853,18 @@ for(i=0;i<numIndices;++i) { ...@@ -845,17 +853,18 @@ for(i=0;i<numIndices;++i) {
if(ind[i].indisunique) free(ind[i].indisunique); if(ind[i].indisunique) free(ind[i].indisunique);
for(a=0;a<INDEX_MAX_KEYS;++a) { for(a=0;a<INDEX_MAX_KEYS;++a) {
if(ind[i].indkey[a]) free(ind[i].indkey[a]); if(ind[i].indkey[a]) free(ind[i].indkey[a]);
if(ind[i].indclass[a]) free(ind[i].indclass[a]);} if(ind[i].indclass[a]) free(ind[i].indclass[a]);
} }
free(ind); }
free(ind);
} }
void void
clearAggInfo(AggInfo *agginfo, int numArgs) clearAggInfo(AggInfo *agginfo, int numArgs)
{ {
int i; int i;
if(!agginfo) return; if(!agginfo) return;
for(i=0;i<numArgs;++i) { for(i=0;i<numArgs;++i) {
if(agginfo[i].oid) free (agginfo[i].oid); if(agginfo[i].oid) free (agginfo[i].oid);
if(agginfo[i].aggname) free (agginfo[i].aggname); if(agginfo[i].aggname) free (agginfo[i].aggname);
if(agginfo[i].aggtransfn1) free (agginfo[i].aggtransfn1); if(agginfo[i].aggtransfn1) free (agginfo[i].aggtransfn1);
...@@ -868,7 +877,7 @@ for(i=0;i<numArgs;++i) { ...@@ -868,7 +877,7 @@ for(i=0;i<numArgs;++i) {
if(agginfo[i].agginitval2) free (agginfo[i].agginitval2); if(agginfo[i].agginitval2) free (agginfo[i].agginitval2);
if(agginfo[i].usename) free (agginfo[i].usename); if(agginfo[i].usename) free (agginfo[i].usename);
} }
free (agginfo); free (agginfo);
} }
/* /*
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: pg_dump.h,v 1.16 1997/06/21 16:08:15 momjian Exp $ * $Id: pg_dump.h,v 1.17 1997/07/23 17:15:13 momjian Exp $
* *
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2 * Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
* *
...@@ -85,7 +85,6 @@ typedef struct _tableInfo { ...@@ -85,7 +85,6 @@ typedef struct _tableInfo {
} TableInfo; } TableInfo;
typedef struct _inhInfo { typedef struct _inhInfo {
char *oid;
char *inhrel; char *inhrel;
char *inhparent; char *inhparent;
} InhInfo; } InhInfo;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment