@@ -37,6 +37,8 @@ main(int argc, char *argv[])
37
37
{"no-inherit" , no_argument , NULL , 'I' },
38
38
{"login" , no_argument , NULL , 'l' },
39
39
{"no-login" , no_argument , NULL , 'L' },
40
+ {"replication" , no_argument , NULL , 1 },
41
+ {"no-replication" , no_argument , NULL , 2 },
40
42
/* adduser is obsolete, undocumented spelling of superuser */
41
43
{"adduser" , no_argument , NULL , 'a' },
42
44
{"no-adduser" , no_argument , NULL , 'A' },
@@ -66,6 +68,7 @@ main(int argc, char *argv[])
66
68
createrole = TRI_DEFAULT ,
67
69
inherit = TRI_DEFAULT ,
68
70
login = TRI_DEFAULT ,
71
+ replication = TRI_DEFAULT ,
69
72
encrypted = TRI_DEFAULT ;
70
73
71
74
PQExpBufferData sql ;
@@ -145,6 +148,12 @@ main(int argc, char *argv[])
145
148
case 'N' :
146
149
encrypted = TRI_NO ;
147
150
break ;
151
+ case 1 :
152
+ replication = TRI_YES ;
153
+ break ;
154
+ case 2 :
155
+ replication = TRI_NO ;
156
+ break ;
148
157
default :
149
158
fprintf (stderr , _ ("Try \"%s --help\" for more information.\n" ), progname );
150
159
exit (1 );
@@ -271,6 +280,10 @@ main(int argc, char *argv[])
271
280
appendPQExpBuffer (& sql , " LOGIN" );
272
281
if (login == TRI_NO )
273
282
appendPQExpBuffer (& sql , " NOLOGIN" );
283
+ if (replication == TRI_YES )
284
+ appendPQExpBuffer (& sql , " REPLICATION" );
285
+ if (replication == TRI_NO )
286
+ appendPQExpBuffer (& sql , " NOREPLICATION" );
274
287
if (conn_limit != NULL )
275
288
appendPQExpBuffer (& sql , " CONNECTION LIMIT %s" , conn_limit );
276
289
appendPQExpBuffer (& sql , ";\n" );
@@ -316,6 +329,8 @@ help(const char *progname)
316
329
printf (_ (" -R, --no-createrole role cannot create roles\n" ));
317
330
printf (_ (" -s, --superuser role will be superuser\n" ));
318
331
printf (_ (" -S, --no-superuser role will not be superuser\n" ));
332
+ printf (_ (" --replication role can initiate replication\n" ));
333
+ printf (_ (" --no-replication role cannot initiate replication\n" ));
319
334
printf (_ (" --help show this help, then exit\n" ));
320
335
printf (_ (" --version output version information, then exit\n" ));
321
336
printf (_ ("\nConnection options:\n" ));
0 commit comments