Skip to content

Commit e9bfedc

Browse files
committed
Fix length limit, MikeA
1 parent 6354986 commit e9bfedc

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
*
2323
* IDENTIFICATION
24-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.128 1999/12/27 15:45:04 momjian Exp $
24+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.129 1999/12/27 18:21:07 momjian Exp $
2525
*
2626
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
2727
*
@@ -1596,9 +1596,14 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
15961596
const char *expr = PQgetvalue(res2, i2, i_rcsrc);
15971597

15981598
resetPQExpBuffer(query);
1599-
if (name[0] != '$')
1600-
appendPQExpBuffer(query, "CONSTRAINT %s ", fmtId(name, force_quotes));
1601-
appendPQExpBuffer(query, "CHECK (%s)", expr);
1599+
if (name[0] != '$') {
1600+
appendPQExpBuffer(query, "CONSTRAINT ");
1601+
appendPQExpBuffer(query, fmtId(name, force_quotes));
1602+
appendPQExpBufferChar(query, ' ');
1603+
}
1604+
appendPQExpBuffer(query, "CHECK (");
1605+
appendPQExpBuffer(query, expr);
1606+
appendPQExpBuffer(query, ")");
16021607
tblinfo[i].check_expr[i2] = strdup(query->data);
16031608
}
16041609
PQclear(res2);
@@ -1614,7 +1619,7 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
16141619
int j;
16151620

16161621
resetPQExpBuffer(query);
1617-
appendPQExpBuffer(query,
1622+
appendPQExpBuffer(query,
16181623
"SELECT a.attname "
16191624
"FROM pg_index i, pg_class c, pg_attribute a "
16201625
"WHERE i.indisprimary AND i.indrelid = %s "
@@ -1731,7 +1736,9 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
17311736
#endif
17321737

17331738
resetPQExpBuffer(query);
1734-
appendPQExpBuffer(query, "CREATE TRIGGER %s ", fmtId(PQgetvalue(res2, i2, i_tgname), force_quotes));
1739+
appendPQExpBuffer(query, "CREATE TRIGGER ");
1740+
appendPQExpBuffer(query, fmtId(PQgetvalue(res2, i2, i_tgname), force_quotes));
1741+
appendPQExpBufferChar(query, ' ');
17351742
/* Trigger type */
17361743
findx = 0;
17371744
if (TRIGGER_FOR_BEFORE(tgtype))
@@ -1792,8 +1799,10 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
17921799
appendPQExpBufferChar(farg, '\\');
17931800
appendPQExpBufferChar(farg, *s++);
17941801
}
1795-
appendPQExpBuffer(query, "'%s'%s", farg->data,
1796-
(findx < tgnargs - 1) ? ", " : "");
1802+
appendPQExpBufferChar(query, '\'');
1803+
appendPQExpBuffer(query, farg->data);
1804+
appendPQExpBufferChar(query, '\'');
1805+
appendPQExpBuffer(query, (findx < tgnargs - 1) ? ", " : "");
17971806
tgargs = p + 4;
17981807
}
17991808
appendPQExpBuffer(query, ");\n");

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy