*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.128 1999/12/27 15:45:04 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.129 1999/12/27 18:21:07 momjian Exp $
*
*
const char *expr = PQgetvalue(res2, i2, i_rcsrc);
resetPQExpBuffer(query);
- if (name[0] != '$')
- appendPQExpBuffer(query, "CONSTRAINT %s ", fmtId(name, force_quotes));
- appendPQExpBuffer(query, "CHECK (%s)", expr);
+ if (name[0] != '$') {
+ appendPQExpBuffer(query, "CONSTRAINT ");
+ appendPQExpBuffer(query, fmtId(name, force_quotes));
+ appendPQExpBufferChar(query, ' ');
+ }
+ appendPQExpBuffer(query, "CHECK (");
+ appendPQExpBuffer(query, expr);
+ appendPQExpBuffer(query, ")");
tblinfo[i].check_expr[i2] = strdup(query->data);
}
PQclear(res2);
int j;
resetPQExpBuffer(query);
- appendPQExpBuffer(query,
+ appendPQExpBuffer(query,
"SELECT a.attname "
"FROM pg_index i, pg_class c, pg_attribute a "
"WHERE i.indisprimary AND i.indrelid = %s "
#endif
resetPQExpBuffer(query);
- appendPQExpBuffer(query, "CREATE TRIGGER %s ", fmtId(PQgetvalue(res2, i2, i_tgname), force_quotes));
+ appendPQExpBuffer(query, "CREATE TRIGGER ");
+ appendPQExpBuffer(query, fmtId(PQgetvalue(res2, i2, i_tgname), force_quotes));
+ appendPQExpBufferChar(query, ' ');
/* Trigger type */
findx = 0;
if (TRIGGER_FOR_BEFORE(tgtype))
appendPQExpBufferChar(farg, '\\');
appendPQExpBufferChar(farg, *s++);
}
- appendPQExpBuffer(query, "'%s'%s", farg->data,
- (findx < tgnargs - 1) ? ", " : "");
+ appendPQExpBufferChar(query, '\'');
+ appendPQExpBuffer(query, farg->data);
+ appendPQExpBufferChar(query, '\'');
+ appendPQExpBuffer(query, (findx < tgnargs - 1) ? ", " : "");
tgargs = p + 4;
}
appendPQExpBuffer(query, ");\n");