21
21
*
22
22
*
23
23
* 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 $
25
25
*
26
26
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
27
27
*
@@ -110,7 +110,6 @@ int dumpData; /* dump data using proper insert strings */
110
110
int attrNames ; /* put attr names into insert strings */
111
111
int schemaOnly ;
112
112
int dataOnly ;
113
- int compatConstraint ;
114
113
115
114
char g_opaque_type [10 ]; /* name for the opaque type */
116
115
@@ -126,8 +125,6 @@ usage(const char *progname)
126
125
"usage: %s [options] dbname\n" , progname );
127
126
fprintf (stderr ,
128
127
"\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" );
131
128
fprintf (stderr ,
132
129
"\t -d \t\t dump data as proper insert strings\n" );
133
130
fprintf (stderr ,
@@ -553,21 +550,17 @@ main(int argc, char **argv)
553
550
g_comment_end [0 ] = '\0' ;
554
551
strcpy (g_opaque_type , "opaque" );
555
552
556
- compatConstraint = dataOnly = schemaOnly = dumpData = attrNames = 0 ;
553
+ dataOnly = schemaOnly = dumpData = attrNames = 0 ;
557
554
558
555
progname = * argv ;
559
556
560
- while ((c = getopt (argc , argv , "acdDf :h:op:st:vzu" )) != EOF )
557
+ while ((c = getopt (argc , argv , "adDf :h:op:st:vzu" )) != EOF )
561
558
{
562
559
switch (c )
563
560
{
564
561
case 'a' : /* Dump data only */
565
562
dataOnly = 1 ;
566
563
break ;
567
- case 'c' : /* generate constraint syntax that
568
- can be read back into postgreSQL */
569
- compatConstraint = 1 ;
570
- break ;
571
564
case 'd' : /* dump data as proper insert strings */
572
565
dumpData = 1 ;
573
566
break ;
@@ -1499,12 +1492,7 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
1499
1492
query [0 ] = 0 ;
1500
1493
if (name [0 ] != '$' )
1501
1494
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 );
1508
1496
tblinfo [i ].check_expr [i2 ] = strdup (query );
1509
1497
}
1510
1498
PQclear (res2 );
@@ -2522,15 +2510,13 @@ dumpTables(FILE *fout, TableInfo *tblinfo, int numTables,
2522
2510
}
2523
2511
}
2524
2512
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 ]);
2534
2520
}
2535
2521
2536
2522
strcat (q , ")" );
@@ -2548,18 +2534,6 @@ dumpTables(FILE *fout, TableInfo *tblinfo, int numTables,
2548
2534
strcat (q , ")" );
2549
2535
}
2550
2536
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
-
2563
2537
strcat (q , ";\n" );
2564
2538
fputs (q , fout );
2565
2539
if (acls )
0 commit comments