@@ -37,6 +37,8 @@ main(int argc, char *argv[])
3737 {"no-inherit" , no_argument , NULL , 'I' },
3838 {"login" , no_argument , NULL , 'l' },
3939 {"no-login" , no_argument , NULL , 'L' },
40+ {"replication" , no_argument , NULL , 1 },
41+ {"no-replication" , no_argument , NULL , 2 },
4042 /* adduser is obsolete, undocumented spelling of superuser */
4143 {"adduser" , no_argument , NULL , 'a' },
4244 {"no-adduser" , no_argument , NULL , 'A' },
@@ -66,6 +68,7 @@ main(int argc, char *argv[])
6668 createrole = TRI_DEFAULT ,
6769 inherit = TRI_DEFAULT ,
6870 login = TRI_DEFAULT ,
71+ replication = TRI_DEFAULT ,
6972 encrypted = TRI_DEFAULT ;
7073
7174 PQExpBufferData sql ;
@@ -145,6 +148,12 @@ main(int argc, char *argv[])
145148 case 'N' :
146149 encrypted = TRI_NO ;
147150 break ;
151+ case 1 :
152+ replication = TRI_YES ;
153+ break ;
154+ case 2 :
155+ replication = TRI_NO ;
156+ break ;
148157 default :
149158 fprintf (stderr , _ ("Try \"%s --help\" for more information.\n" ), progname );
150159 exit (1 );
@@ -271,6 +280,10 @@ main(int argc, char *argv[])
271280 appendPQExpBuffer (& sql , " LOGIN" );
272281 if (login == TRI_NO )
273282 appendPQExpBuffer (& sql , " NOLOGIN" );
283+ if (replication == TRI_YES )
284+ appendPQExpBuffer (& sql , " REPLICATION" );
285+ if (replication == TRI_NO )
286+ appendPQExpBuffer (& sql , " NOREPLICATION" );
274287 if (conn_limit != NULL )
275288 appendPQExpBuffer (& sql , " CONNECTION LIMIT %s" , conn_limit );
276289 appendPQExpBuffer (& sql , ";\n" );
@@ -316,6 +329,8 @@ help(const char *progname)
316329 printf (_ (" -R, --no-createrole role cannot create roles\n" ));
317330 printf (_ (" -s, --superuser role will be superuser\n" ));
318331 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" ));
319334 printf (_ (" --help show this help, then exit\n" ));
320335 printf (_ (" --version output version information, then exit\n" ));
321336 printf (_ ("\nConnection options:\n" ));
0 commit comments