aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1998-06-20 02:49:38 +0000
committerBruce Momjian <bruce@momjian.us>1998-06-20 02:49:38 +0000
commit454913c19ab94bc71d86017744b0a666e46aa42c (patch)
tree3d3c1ac3ed1b99eaabe20978938b72c139829e2b
parent5fdefbc7ef5884d19573e758c1a7c9200a42022a (diff)
downloadpostgresql-454913c19ab94bc71d86017744b0a666e46aa42c.tar.gz
postgresql-454913c19ab94bc71d86017744b0a666e46aa42c.zip
Remove -c option for Constraint syntax so we us it by default.
-rw-r--r--src/bin/pg_dump/pg_dump.c48
1 files changed, 11 insertions, 37 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 72438963124..aa7281beb60 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -21,7 +21,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.75 1998/06/19 02:55:14 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.76 1998/06/20 02:49:38 momjian Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
@@ -110,7 +110,6 @@ int dumpData; /* dump data using proper insert strings */
int attrNames; /* put attr names into insert strings */
int schemaOnly;
int dataOnly;
-int compatConstraint;
char g_opaque_type[10]; /* name for the opaque type */
@@ -127,8 +126,6 @@ usage(const char *progname)
fprintf(stderr,
"\t -a \t\t dump out only the data, no schema\n");
fprintf(stderr,
- "\t -c \t\t generate pgsql-compatible CONSTRAINT syntax\n");
- fprintf(stderr,
"\t -d \t\t dump data as proper insert strings\n");
fprintf(stderr,
"\t -D \t\t dump data as inserts with attribute names\n");
@@ -553,21 +550,17 @@ main(int argc, char **argv)
g_comment_end[0] = '\0';
strcpy(g_opaque_type, "opaque");
- compatConstraint = dataOnly = schemaOnly = dumpData = attrNames = 0;
+ dataOnly = schemaOnly = dumpData = attrNames = 0;
progname = *argv;
- while ((c = getopt(argc, argv, "acdDf:h:op:st:vzu")) != EOF)
+ while ((c = getopt(argc, argv, "adDf:h:op:st:vzu")) != EOF)
{
switch (c)
{
case 'a': /* Dump data only */
dataOnly = 1;
break;
- case 'c': /* generate constraint syntax that
- can be read back into postgreSQL */
- compatConstraint = 1;
- break;
case 'd': /* dump data as proper insert strings */
dumpData = 1;
break;
@@ -1499,12 +1492,7 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
query[0] = 0;
if (name[0] != '$')
sprintf(query, "CONSTRAINT %s ", name);
- if( compatConstraint ) {
- sprintf(query, "%sCHECK (%s)", query, expr);
- }
- else {
- sprintf(query, "%sCHECK %s", query, expr);
- }
+ sprintf(query, "%sCHECK (%s)", query, expr);
tblinfo[i].check_expr[i2] = strdup(query);
}
PQclear(res2);
@@ -2522,15 +2510,13 @@ dumpTables(FILE *fout, TableInfo *tblinfo, int numTables,
}
}
- if( compatConstraint ) {
- /* put the CONSTRAINTS inside the table def */
- for (k = 0; k < tblinfo[i].ncheck; k++)
- {
- sprintf(q, "%s%s %s",
- q,
- (actual_atts + k > 0) ? ", " : "",
- tblinfo[i].check_expr[k]);
- }
+ /* put the CONSTRAINTS inside the table def */
+ for (k = 0; k < tblinfo[i].ncheck; k++)
+ {
+ sprintf(q, "%s%s %s",
+ q,
+ (actual_atts + k > 0) ? ", " : "",
+ tblinfo[i].check_expr[k]);
}
strcat(q, ")");
@@ -2548,18 +2534,6 @@ dumpTables(FILE *fout, TableInfo *tblinfo, int numTables,
strcat(q, ")");
}
- if( !compatConstraint )
- {
- /* put the CONSTRAINT defs outside the table def */
- for (k = 0; k < tblinfo[i].ncheck; k++)
- {
- sprintf(q, "%s%s %s",
- q,
- (k > 0) ? ", " : "",
- tblinfo[i].check_expr[k]);
- }
- }
-
strcat(q, ";\n");
fputs(q, fout);
if (acls)