Index: src/bin/pg_dump/common.c =================================================================== RCS file: /var/lib/cvs/pgsql/src/bin/pg_dump/common.c,v retrieving revision 1.62 diff -c -r1.62 common.c *** src/bin/pg_dump/common.c 11 Feb 2002 00:18:20 -0000 1.62 --- src/bin/pg_dump/common.c 15 Apr 2002 22:29:51 -0000 *************** *** 34,39 **** --- 34,41 ---- #include "postgres_fe.h" #include "pg_dump.h" #include "pg_backup_archiver.h" + #include "postgres.h" + #include "catalog/pg_class.h" #include *************** *** 234,239 **** --- 236,242 ---- temp[j++] = s; } } + while (argNum < arraysize) array[argNum++] = strdup("0"); } *************** *** 344,351 **** 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); if (fout && !dataOnly) { --- 347,354 ---- if (g_verbose) write_msg(NULL, "dumping out tables\n"); ! dumpTables(fout, tblinfo, numTables, tablename, ! aclsSkip, schemaOnly, dataOnly); if (fout && !dataOnly) { *************** *** 425,433 **** */ for (i = numTables - 1; i >= 0; i--) { - /* Sequences can never have parents, and attr info is undefined */ ! if (tblinfo[i].sequence) continue; /* Get all the parents and their indexes. */ --- 428,435 ---- */ for (i = numTables - 1; i >= 0; i--) { /* Sequences can never have parents, and attr info is undefined */ ! if (tblinfo[i].relkind == RELKIND_SEQUENCE) continue; /* Get all the parents and their indexes. */ Index: src/bin/pg_dump/pg_dump.c =================================================================== RCS file: /var/lib/cvs/pgsql/src/bin/pg_dump/pg_dump.c,v retrieving revision 1.248 diff -c -r1.248 pg_dump.c *** src/bin/pg_dump/pg_dump.c 13 Apr 2002 19:57:18 -0000 1.248 --- src/bin/pg_dump/pg_dump.c 15 Apr 2002 22:29:51 -0000 *************** *** 574,580 **** if (tblinfo[i].viewdef != NULL) continue; ! if (tblinfo[i].sequence) /* already dumped */ continue; if (!onlytable || (strcmp(classname, onlytable) == 0) || (strlen(onlytable) == 0)) --- 574,580 ---- if (tblinfo[i].viewdef != NULL) continue; ! if (tblinfo[i].relkind == RELKIND_SEQUENCE) /* already dumped */ continue; if (!onlytable || (strcmp(classname, onlytable) == 0) || (strlen(onlytable) == 0)) *************** *** 1668,1674 **** if (tblinfo[i].relname) free(tblinfo[i].relname); ! if (tblinfo[i].sequence) continue; /* Process Attributes */ --- 1668,1674 ---- if (tblinfo[i].relname) free(tblinfo[i].relname); ! if (tblinfo[i].relkind == RELKIND_SEQUENCE) continue; /* Process Attributes */ *************** *** 2213,2219 **** 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)); --- 2213,2218 ---- *************** *** 2850,2856 **** for (i = 0; i < numTables; i++) { ! if (tblinfo[i].sequence) continue; /* find all the user attributes and their types */ --- 2849,2855 ---- for (i = 0; i < numTables; i++) { ! if (tblinfo[i].relkind == RELKIND_SEQUENCE) continue; /* find all the user attributes and their types */ *************** *** 4234,4240 **** } static void ! _dumpTableAttr70(Archive *fout, TableInfo *tblinfo, int i, int j, PQExpBuffer q) { int32 tmp_typmod; int precision; --- 4233,4239 ---- } static void ! _dumpTableAttr70(TableInfo *tblinfo, int i, int j, PQExpBuffer q) { int32 tmp_typmod; int precision; *************** *** 4295,4304 **** 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 bool schemaOnly, const bool dataOnly) { int i, --- 4294,4300 ---- void dumpTables(Archive *fout, TableInfo *tblinfo, int numTables, ! const char *tablename, const bool aclsSkip, const bool schemaOnly, const bool dataOnly) { int i, *************** *** 4328,4334 **** } for (i = 0; i < numTables; i++) { ! if (!(tblinfo[i].sequence)) continue; if (!tablename || (!strcmp(tblinfo[i].relname, tablename)) || (serialSeq && !strcmp(tblinfo[i].relname, serialSeq))) --- 4324,4330 ---- } for (i = 0; i < numTables; i++) { ! if (tblinfo[i].relkind != RELKIND_SEQUENCE) continue; if (!tablename || (!strcmp(tblinfo[i].relname, tablename)) || (serialSeq && !strcmp(tblinfo[i].relname, serialSeq))) *************** *** 4344,4350 **** for (i = 0; i < numTables; i++) { ! if (tblinfo[i].sequence) /* already dumped */ continue; if (!tablename || (!strcmp(tblinfo[i].relname, tablename)) || (strlen(tablename) == 0)) --- 4340,4346 ---- for (i = 0; i < numTables; i++) { ! if (tblinfo[i].relkind == RELKIND_SEQUENCE) /* already dumped */ continue; if (!tablename || (!strcmp(tblinfo[i].relname, tablename)) || (strlen(tablename) == 0)) *************** *** 4391,4397 **** if (g_fout->remoteVersion >= 70100) appendPQExpBuffer(q, "%s", tblinfo[i].atttypedefns[j]); else ! _dumpTableAttr70(fout, tblinfo, i, j, q); /* Default value */ if (tblinfo[i].adef_expr[j] != NULL && tblinfo[i].inhAttrDef[j] == 0) --- 4387,4393 ---- if (g_fout->remoteVersion >= 70100) appendPQExpBuffer(q, "%s", tblinfo[i].atttypedefns[j]); else ! _dumpTableAttr70(tblinfo, i, j, q); /* Default value */ if (tblinfo[i].adef_expr[j] != NULL && tblinfo[i].inhAttrDef[j] == 0) Index: src/bin/pg_dump/pg_dump.h =================================================================== RCS file: /var/lib/cvs/pgsql/src/bin/pg_dump/pg_dump.h,v retrieving revision 1.81 diff -c -r1.81 pg_dump.h *** src/bin/pg_dump/pg_dump.h 11 Apr 2002 20:00:08 -0000 1.81 --- src/bin/pg_dump/pg_dump.h 15 Apr 2002 22:29:51 -0000 *************** *** 99,105 **** * 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 */ --- 99,104 ---- *************** *** 275,284 **** 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 bool schemaOnly, const bool dataOnly); extern void dumpIndexes(Archive *fout, IndInfo *indinfo, int numIndexes, TableInfo *tbinfo, int numTables, const char *tablename); --- 274,280 ---- extern void dumpOprs(Archive *fout, OprInfo *agginfo, int numOperators, TypeInfo *tinfo, int numTypes); extern void dumpTables(Archive *fout, TableInfo *tbinfo, int numTables, ! 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);