@@ -291,6 +291,7 @@ main(int argc, char **argv)
291
291
static struct option long_options [] = {
292
292
{"data-only" , no_argument , NULL , 'a' },
293
293
{"blobs" , no_argument , NULL , 'b' },
294
+ {"no-blobs" , no_argument , NULL , 'B' },
294
295
{"clean" , no_argument , NULL , 'c' },
295
296
{"create" , no_argument , NULL , 'C' },
296
297
{"dbname" , required_argument , NULL , 'd' },
@@ -379,7 +380,7 @@ main(int argc, char **argv)
379
380
380
381
InitDumpOptions (& dopt );
381
382
382
- while ((c = getopt_long (argc , argv , "abcCd :E:f:F:h:j:n:N:oOp:RsS:t:T:U:vwWxZ:" ,
383
+ while ((c = getopt_long (argc , argv , "abBcCd :E:f:F:h:j:n:N:oOp:RsS:t:T:U:vwWxZ:" ,
383
384
long_options , & optindex )) != -1 )
384
385
{
385
386
switch (c )
@@ -392,6 +393,10 @@ main(int argc, char **argv)
392
393
dopt .outputBlobs = true;
393
394
break ;
394
395
396
+ case 'B' : /* Don't dump blobs */
397
+ dopt .dontOutputBlobs = true;
398
+ break ;
399
+
395
400
case 'c' : /* clean (i.e., drop) schema prior to create */
396
401
dopt .outputClean = 1 ;
397
402
break ;
@@ -713,10 +718,15 @@ main(int argc, char **argv)
713
718
/* non-matching exclusion patterns aren't an error */
714
719
715
720
/*
716
- * Dumping blobs is now default unless we saw an inclusion switch or -s
717
- * ... but even if we did see one of these, -b turns it back on.
721
+ * Dumping blobs is the default for dumps where an inclusion switch is not
722
+ * used (an "include everything" dump). -B can be used to exclude blobs
723
+ * from those dumps. -b can be used to include blobs even when an
724
+ * inclusion switch is used.
725
+ *
726
+ * -s means "schema only" and blobs are data, not schema, so we never
727
+ * include blobs when -s is used.
718
728
*/
719
- if (dopt .include_everything && !dopt .schemaOnly )
729
+ if (dopt .include_everything && !dopt .schemaOnly && ! dopt . dontOutputBlobs )
720
730
dopt .outputBlobs = true;
721
731
722
732
/*
@@ -876,6 +886,7 @@ help(const char *progname)
876
886
printf (_ ("\nOptions controlling the output content:\n" ));
877
887
printf (_ (" -a, --data-only dump only the data, not the schema\n" ));
878
888
printf (_ (" -b, --blobs include large objects in dump\n" ));
889
+ printf (_ (" -B, --no-blobs exclude large objects in dump\n" ));
879
890
printf (_ (" -c, --clean clean (drop) database objects before recreating\n" ));
880
891
printf (_ (" -C, --create include commands to create database in dump\n" ));
881
892
printf (_ (" -E, --encoding=ENCODING dump the data in encoding ENCODING\n" ));
0 commit comments