@@ -78,6 +78,7 @@ static int no_unlogged_table_data = 0;
78
78
static int no_role_passwords = 0 ;
79
79
static int server_version ;
80
80
static int load_via_partition_root = 0 ;
81
+ static int on_conflict_do_nothing = 0 ;
81
82
82
83
static char role_catalog [10 ];
83
84
#define PG_AUTHID "pg_authid"
@@ -137,6 +138,7 @@ main(int argc, char *argv[])
137
138
{"no-subscriptions" , no_argument , & no_subscriptions , 1 },
138
139
{"no-sync" , no_argument , NULL , 4 },
139
140
{"no-unlogged-table-data" , no_argument , & no_unlogged_table_data , 1 },
141
+ {"on-conflict-do-nothing" , no_argument , & on_conflict_do_nothing , 1 },
140
142
141
143
{NULL , 0 , NULL , 0 }
142
144
};
@@ -406,6 +408,8 @@ main(int argc, char *argv[])
406
408
appendPQExpBufferStr (pgdumpopts , " --no-subscriptions" );
407
409
if (no_unlogged_table_data )
408
410
appendPQExpBufferStr (pgdumpopts , " --no-unlogged-table-data" );
411
+ if (on_conflict_do_nothing )
412
+ appendPQExpBufferStr (pgdumpopts , " --on-conflict-do-nothing" );
409
413
410
414
/*
411
415
* If there was a database specified on the command line, use that,
@@ -621,6 +625,7 @@ help(void)
621
625
printf (_ (" --no-sync do not wait for changes to be written safely to disk\n" ));
622
626
printf (_ (" --no-tablespaces do not dump tablespace assignments\n" ));
623
627
printf (_ (" --no-unlogged-table-data do not dump unlogged table data\n" ));
628
+ printf (_ (" --on-conflict-do-nothing add ON CONFLICT DO NOTHING to INSERT commands\n" ));
624
629
printf (_ (" --quote-all-identifiers quote all identifiers, even if not key words\n" ));
625
630
printf (_ (" --use-set-session-authorization\n"
626
631
" use SET SESSION AUTHORIZATION commands instead of\n"
0 commit comments