*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.62 2002/02/11 00:18:20 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.63 2002/04/24 02:44:19 momjian Exp $
*
*
#include "postgres_fe.h"
#include "pg_dump.h"
#include "pg_backup_archiver.h"
+#include "postgres.h"
+#include "catalog/pg_class.h"
#include
temp[j++] = s;
}
}
+
while (argNum < arraysize)
array[argNum++] = strdup("0");
}
if (g_verbose)
write_msg(NULL, "dumping out tables\n");
- dumpTables(fout, tblinfo, numTables, indinfo, numIndexes, inhinfo, numInherits,
- tinfo, numTypes, tablename, aclsSkip, oids, schemaOnly, dataOnly);
+ dumpTables(fout, tblinfo, numTables, tablename,
+ aclsSkip, schemaOnly, dataOnly);
if (fout && !dataOnly)
{
*/
for (i = numTables - 1; i >= 0; i--)
{
-
/* Sequences can never have parents, and attr info is undefined */
- if (tblinfo[i].sequence)
+ if (tblinfo[i].relkind == RELKIND_SEQUENCE)
continue;
/* Get all the parents and their indexes. */
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.253 2002/04/24 02:42:27 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.254 2002/04/24 02:44:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
if (tblinfo[i].viewdef != NULL)
continue;
- if (tblinfo[i].sequence) /* already dumped */
+ if (tblinfo[i].relkind == RELKIND_SEQUENCE) /* already dumped */
continue;
if (!onlytable || (strcmp(classname, onlytable) == 0) || (strlen(onlytable) == 0))
if (tblinfo[i].relname)
free(tblinfo[i].relname);
- if (tblinfo[i].sequence)
+ if (tblinfo[i].relkind == RELKIND_SEQUENCE)
continue;
/* Process Attributes */
tblinfo[i].relname = strdup(PQgetvalue(res, i, i_relname));
tblinfo[i].relacl = strdup(PQgetvalue(res, i, i_relacl));
tblinfo[i].relkind = *(PQgetvalue(res, i, i_relkind));
- tblinfo[i].sequence = (tblinfo[i].relkind == RELKIND_SEQUENCE);
tblinfo[i].hasindex = (strcmp(PQgetvalue(res, i, i_relhasindex), "t") == 0);
tblinfo[i].hasoids = (strcmp(PQgetvalue(res, i, i_relhasoids), "t") == 0);
tblinfo[i].usename = strdup(PQgetvalue(res, i, i_usename));
for (i = 0; i < numTables; i++)
{
- if (tblinfo[i].sequence)
+ if (tblinfo[i].relkind == RELKIND_SEQUENCE)
continue;
/* find all the user attributes and their types */
}
static void
-_dumpTableAttr70(Archive *fout, TableInfo *tblinfo, int i, int j, PQExpBuffer q)
+_dumpTableAttr70(TableInfo *tblinfo, int i, int j, PQExpBuffer q)
{
int32 tmp_typmod;
int precision;
void
dumpTables(Archive *fout, TableInfo *tblinfo, int numTables,
- IndInfo *indinfo, int numIndexes,
- InhInfo *inhinfo, int numInherits,
- TypeInfo *tinfo, int numTypes, const char *tablename,
- const bool aclsSkip, const bool oids,
+ const char *tablename, const bool aclsSkip,
const bool schemaOnly, const bool dataOnly)
{
int i,
}
for (i = 0; i < numTables; i++)
{
- if (!(tblinfo[i].sequence))
+ if (tblinfo[i].relkind != RELKIND_SEQUENCE)
continue;
if (!tablename || (!strcmp(tblinfo[i].relname, tablename))
|| (serialSeq && !strcmp(tblinfo[i].relname, serialSeq)))
for (i = 0; i < numTables; i++)
{
- if (tblinfo[i].sequence) /* already dumped */
+ if (tblinfo[i].relkind == RELKIND_SEQUENCE) /* already dumped */
continue;
if (!tablename || (!strcmp(tblinfo[i].relname, tablename)) || (strlen(tablename) == 0))
if (g_fout->remoteVersion >= 70100)
appendPQExpBuffer(q, "%s", tblinfo[i].atttypedefns[j]);
else
- _dumpTableAttr70(fout, tblinfo, i, j, q);
+ _dumpTableAttr70(tblinfo, i, j, q);
/* Default value */
if (tblinfo[i].adef_expr[j] != NULL && tblinfo[i].inhAttrDef[j] == 0)
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_dump.h,v 1.82 2002/04/21 05:21:18 petere Exp $
+ * $Id: pg_dump.h,v 1.83 2002/04/24 02:44:19 momjian Exp $
*
*
* rule may ref things created after the
* base table was created. */
char relkind;
- bool sequence; /* this is redundant with relkind... */
bool hasindex; /* does it have any indexes? */
bool hasoids; /* does it have OIDs? */
int numatts; /* number of attributes */
extern void dumpOprs(Archive *fout, OprInfo *agginfo, int numOperators,
TypeInfo *tinfo, int numTypes);
extern void dumpTables(Archive *fout, TableInfo *tbinfo, int numTables,
- IndInfo *indinfo, int numIndexes,
- InhInfo *inhinfo, int numInherits,
- TypeInfo *tinfo, int numTypes, const char *tablename,
- const bool acls, const bool oids,
+ const char *tablename, const bool acls,
const bool schemaOnly, const bool dataOnly);
extern void dumpIndexes(Archive *fout, IndInfo *indinfo, int numIndexes,
TableInfo *tbinfo, int numTables, const char *tablename);