Skip to content

Commit 454913c

Browse files
committed
Remove -c option for Constraint syntax so we us it by default.
1 parent 5fdefbc commit 454913c

File tree

1 file changed

+11
-37
lines changed

1 file changed

+11
-37
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 11 additions & 37 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.75 1998/06/19 02:55:14 momjian Exp $
24+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.76 1998/06/20 02:49:38 momjian Exp $
2525
*
2626
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
2727
*
@@ -110,7 +110,6 @@ int dumpData; /* dump data using proper insert strings */
110110
int attrNames; /* put attr names into insert strings */
111111
int schemaOnly;
112112
int dataOnly;
113-
int compatConstraint;
114113

115114
char g_opaque_type[10]; /* name for the opaque type */
116115

@@ -126,8 +125,6 @@ usage(const char *progname)
126125
"usage: %s [options] dbname\n", progname);
127126
fprintf(stderr,
128127
"\t -a \t\t dump out only the data, no schema\n");
129-
fprintf(stderr,
130-
"\t -c \t\t generate pgsql-compatible CONSTRAINT syntax\n");
131128
fprintf(stderr,
132129
"\t -d \t\t dump data as proper insert strings\n");
133130
fprintf(stderr,
@@ -553,21 +550,17 @@ main(int argc, char **argv)
553550
g_comment_end[0] = '\0';
554551
strcpy(g_opaque_type, "opaque");
555552

556-
compatConstraint = dataOnly = schemaOnly = dumpData = attrNames = 0;
553+
dataOnly = schemaOnly = dumpData = attrNames = 0;
557554

558555
progname = *argv;
559556

560-
while ((c = getopt(argc, argv, "acdDf:h:op:st:vzu")) != EOF)
557+
while ((c = getopt(argc, argv, "adDf:h:op:st:vzu")) != EOF)
561558
{
562559
switch (c)
563560
{
564561
case 'a': /* Dump data only */
565562
dataOnly = 1;
566563
break;
567-
case 'c': /* generate constraint syntax that
568-
can be read back into postgreSQL */
569-
compatConstraint = 1;
570-
break;
571564
case 'd': /* dump data as proper insert strings */
572565
dumpData = 1;
573566
break;
@@ -1499,12 +1492,7 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
14991492
query[0] = 0;
15001493
if (name[0] != '$')
15011494
sprintf(query, "CONSTRAINT %s ", name);
1502-
if( compatConstraint ) {
1503-
sprintf(query, "%sCHECK (%s)", query, expr);
1504-
}
1505-
else {
1506-
sprintf(query, "%sCHECK %s", query, expr);
1507-
}
1495+
sprintf(query, "%sCHECK (%s)", query, expr);
15081496
tblinfo[i].check_expr[i2] = strdup(query);
15091497
}
15101498
PQclear(res2);
@@ -2522,15 +2510,13 @@ dumpTables(FILE *fout, TableInfo *tblinfo, int numTables,
25222510
}
25232511
}
25242512

2525-
if( compatConstraint ) {
2526-
/* put the CONSTRAINTS inside the table def */
2527-
for (k = 0; k < tblinfo[i].ncheck; k++)
2528-
{
2529-
sprintf(q, "%s%s %s",
2530-
q,
2531-
(actual_atts + k > 0) ? ", " : "",
2532-
tblinfo[i].check_expr[k]);
2533-
}
2513+
/* put the CONSTRAINTS inside the table def */
2514+
for (k = 0; k < tblinfo[i].ncheck; k++)
2515+
{
2516+
sprintf(q, "%s%s %s",
2517+
q,
2518+
(actual_atts + k > 0) ? ", " : "",
2519+
tblinfo[i].check_expr[k]);
25342520
}
25352521

25362522
strcat(q, ")");
@@ -2548,18 +2534,6 @@ dumpTables(FILE *fout, TableInfo *tblinfo, int numTables,
25482534
strcat(q, ")");
25492535
}
25502536

2551-
if( !compatConstraint )
2552-
{
2553-
/* put the CONSTRAINT defs outside the table def */
2554-
for (k = 0; k < tblinfo[i].ncheck; k++)
2555-
{
2556-
sprintf(q, "%s%s %s",
2557-
q,
2558-
(k > 0) ? ", " : "",
2559-
tblinfo[i].check_expr[k]);
2560-
}
2561-
}
2562-
25632537
strcat(q, ";\n");
25642538
fputs(q, fout);
25652539
if (acls)

0 commit comments

Comments
 (0)