+for(i=0;i
+ if(agginfo[i].oid) free (agginfo[i].oid);
+ if(agginfo[i].aggname) free (agginfo[i].aggname);
+ if(agginfo[i].aggtransfn1) free (agginfo[i].aggtransfn1);
+ if(agginfo[i].aggtransfn2) free (agginfo[i].aggtransfn2);
+ if(agginfo[i].aggfinalfn) free (agginfo[i].aggfinalfn);
+ if(agginfo[i].aggtranstype1) free (agginfo[i].aggtranstype1);
+ if(agginfo[i].aggbasetype) free (agginfo[i].aggbasetype);
+ if(agginfo[i].aggtranstype2) free (agginfo[i].aggtranstype2);
+ if(agginfo[i].agginitval1) free (agginfo[i].agginitval1);
+ if(agginfo[i].agginitval2) free (agginfo[i].agginitval2);
+ }
+free (agginfo);
+}
/*
* getAggregates:
*numAggs = ntups;
agginfo = (AggInfo*)malloc(ntups * sizeof(AggInfo));
-
+
i_oid = PQfnumber(res,"oid");
i_aggname = PQfnumber(res,"aggname");
i_aggtransfn1 = PQfnumber(res,"aggtransfn1");
}
PQclear(res);
res = PQexec(g_conn,"end");
-
+ if(res) PQclear(res);
return indinfo;
}
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_dump.h,v 1.14 1997/05/07 02:59:59 scrappy Exp $
+ * $Id: pg_dump.h,v 1.15 1997/06/02 02:52:06 scrappy Exp $
*
*
* - Fixed dumpTable output to output lengths for char and varchar types!
* - Added single. quote to twin single quote expansion for 'insert' string
* mode.
+ *
+ * - Added extern's for the functions that clear allocated memory
+ * in pg_dump.c
*-------------------------------------------------------------------------
*/
typedef struct _indInfo {
char *indexrelname; /* name of the secondary index class */
char *indrelname; /* name of the indexed heap class */
- char *indamname; /* name of the access method (e.g. btree, rtree, etc.) */
- char *indproc; /* oid of the function to compute the index, 0 if none*/
- char *indkey[INDEX_MAX_KEYS]; /* attribute numbers of the key attributes */
+ char *indamname; /* name of the access method (e.g. btree, rtree, etc.) */
+ char *indproc; /* oid of the function to compute the index, 0 if none*/
+ char *indkey[INDEX_MAX_KEYS]; /* attribute numbers of the key attributes */
char *indclass[INDEX_MAX_KEYS]; /* opclass of the keys */
char *indisunique; /* is this index unique? */
} IndInfo;
extern TypeInfo* getTypes(int *numTypes);
extern FuncInfo* getFuncs(int *numFuncs);
extern AggInfo* getAggregates(int *numAggregates);
+
+extern void clearAggInfo(AggInfo*, int);
+extern void clearFuncInfo(FuncInfo*, int);
+extern void clearInhInfo(InhInfo*, int);
+extern void clearIndInfo(IndInfo*, int);
+extern void clearOprInfo(OprInfo*, int);
+extern void clearTypeInfo(TypeInfo*, int);
+extern void clearTableInfo(TableInfo*, int);
+
extern OprInfo* getOperators(int *numOperators);
extern TableInfo* getTables(int *numTables);
extern InhInfo* getInherits(int *numInherits);