Index: src/bin/pg_dump/pg_dump.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v retrieving revision 1.258 diff -c -r1.258 pg_dump.c *** src/bin/pg_dump/pg_dump.c 2002/05/06 18:33:45 1.258 --- src/bin/pg_dump/pg_dump.c 2002/05/11 14:38:45 *************** *** 2346,2353 **** if (tblinfo[i].ncheck > 0) { PGresult *res2; ! int i_rcname, ! i_rcsrc; int ntups2; int i2; --- 2346,2353 ---- if (tblinfo[i].ncheck > 0) { PGresult *res2; ! int i_conname, ! i_consrc; int ntups2; int i2; *************** *** 2356,2373 **** tblinfo[i].relname); resetPQExpBuffer(query); ! appendPQExpBuffer(query, "SELECT rcname, rcsrc from pg_relcheck " ! " where rcrelid = '%s'::oid " " and not exists " ! " (select * from pg_relcheck as c, pg_inherits as i " ! " where i.inhrelid = pg_relcheck.rcrelid " ! " and (c.rcname = pg_relcheck.rcname " ! " or ( c.rcname[0] = '$' " ! " and pg_relcheck.rcname[0] = '$')" " )" ! " and c.rcsrc = pg_relcheck.rcsrc " ! " and c.rcrelid = i.inhparent) " ! " order by rcname ", tblinfo[i].oid); res2 = PQexec(g_conn, query->data); if (!res2 || --- 2356,2375 ---- tblinfo[i].relname); resetPQExpBuffer(query); ! appendPQExpBuffer(query, "SELECT conname, consrc from pg_constraint " ! " where conrelid = '%s'::oid " ! " and contype = 'c' " " and not exists " ! " (select * from pg_constraint as c, pg_inherits as i " ! " where i.inhrelid = pg_constraint.conrelid " ! " and (c.conname = pg_constraint.conname " ! " or ( c.conname like 'constraint_%%' " ! " and pg_constraint.conname like 'constraint_%%')" " )" ! " and contype = 'c' " ! " and c.consrc = pg_constraint.consrc " ! " and c.conrelid = i.inhparent) " ! " order by conname ", tblinfo[i].oid); res2 = PQexec(g_conn, query->data); if (!res2 || *************** *** 2391,2403 **** */ tblinfo[i].ncheck = ntups2; ! i_rcname = PQfnumber(res2, "rcname"); ! i_rcsrc = PQfnumber(res2, "rcsrc"); tblinfo[i].check_expr = (char **) malloc(ntups2 * sizeof(char *)); for (i2 = 0; i2 < ntups2; i2++) { ! const char *name = PQgetvalue(res2, i2, i_rcname); ! const char *expr = PQgetvalue(res2, i2, i_rcsrc); resetPQExpBuffer(query); if (name[0] != '$') --- 2393,2405 ---- */ tblinfo[i].ncheck = ntups2; ! i_conname = PQfnumber(res2, "conname"); ! i_consrc = PQfnumber(res2, "consrc"); tblinfo[i].check_expr = (char **) malloc(ntups2 * sizeof(char *)); for (i2 = 0; i2 < ntups2; i2++) { ! const char *name = PQgetvalue(res2, i2, i_conname); ! const char *expr = PQgetvalue(res2, i2, i_consrc); resetPQExpBuffer(query); if (name[0] != '$')