Commit e9bfedc9 authored by Bruce Momjian's avatar Bruce Momjian

Fix length limit, MikeA

parent 63549862
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* *
* *
* IDENTIFICATION * 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 $
* *
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb * Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
* *
...@@ -1596,9 +1596,14 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs) ...@@ -1596,9 +1596,14 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
const char *expr = PQgetvalue(res2, i2, i_rcsrc); const char *expr = PQgetvalue(res2, i2, i_rcsrc);
resetPQExpBuffer(query); resetPQExpBuffer(query);
if (name[0] != '$') if (name[0] != '$') {
appendPQExpBuffer(query, "CONSTRAINT %s ", fmtId(name, force_quotes)); appendPQExpBuffer(query, "CONSTRAINT ");
appendPQExpBuffer(query, "CHECK (%s)", expr); appendPQExpBuffer(query, fmtId(name, force_quotes));
appendPQExpBufferChar(query, ' ');
}
appendPQExpBuffer(query, "CHECK (");
appendPQExpBuffer(query, expr);
appendPQExpBuffer(query, ")");
tblinfo[i].check_expr[i2] = strdup(query->data); tblinfo[i].check_expr[i2] = strdup(query->data);
} }
PQclear(res2); PQclear(res2);
...@@ -1614,7 +1619,7 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs) ...@@ -1614,7 +1619,7 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
int j; int j;
resetPQExpBuffer(query); resetPQExpBuffer(query);
appendPQExpBuffer(query, appendPQExpBuffer(query,
"SELECT a.attname " "SELECT a.attname "
"FROM pg_index i, pg_class c, pg_attribute a " "FROM pg_index i, pg_class c, pg_attribute a "
"WHERE i.indisprimary AND i.indrelid = %s " "WHERE i.indisprimary AND i.indrelid = %s "
...@@ -1731,7 +1736,9 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs) ...@@ -1731,7 +1736,9 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
#endif #endif
resetPQExpBuffer(query); 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 */ /* Trigger type */
findx = 0; findx = 0;
if (TRIGGER_FOR_BEFORE(tgtype)) if (TRIGGER_FOR_BEFORE(tgtype))
...@@ -1792,8 +1799,10 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs) ...@@ -1792,8 +1799,10 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
appendPQExpBufferChar(farg, '\\'); appendPQExpBufferChar(farg, '\\');
appendPQExpBufferChar(farg, *s++); appendPQExpBufferChar(farg, *s++);
} }
appendPQExpBuffer(query, "'%s'%s", farg->data, appendPQExpBufferChar(query, '\'');
(findx < tgnargs - 1) ? ", " : ""); appendPQExpBuffer(query, farg->data);
appendPQExpBufferChar(query, '\'');
appendPQExpBuffer(query, (findx < tgnargs - 1) ? ", " : "");
tgargs = p + 4; tgargs = p + 4;
} }
appendPQExpBuffer(query, ");\n"); appendPQExpBuffer(query, ");\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment