diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
new file mode 100644
index 00df2c6..5098a79
*** a/src/bin/psql/tab-complete.c
--- b/src/bin/psql/tab-complete.c
*************** psql_completion(char *text, int start, i
*** 1024,1034 ****
  			"ENCRYPTED", "INHERIT", "LOGIN", "NOCREATEDB", "NOCREATEROLE",
  			"NOCREATEUSER", "NOINHERIT", "NOLOGIN", "NOREPLICATION",
  			"NOSUPERUSER", "RENAME TO", "REPLICATION", "RESET", "SET",
! 		"SUPERUSER", "UNENCRYPTED", "VALID UNTIL", NULL};
  
  		COMPLETE_WITH_LIST(list_ALTERUSER);
  	}
  
  	/* complete ALTER USER,ROLE <name> ENCRYPTED,UNENCRYPTED with PASSWORD */
  	else if (pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
  			 (pg_strcasecmp(prev3_wd, "ROLE") == 0 || pg_strcasecmp(prev3_wd, "USER") == 0) &&
--- 1024,1051 ----
  			"ENCRYPTED", "INHERIT", "LOGIN", "NOCREATEDB", "NOCREATEROLE",
  			"NOCREATEUSER", "NOINHERIT", "NOLOGIN", "NOREPLICATION",
  			"NOSUPERUSER", "RENAME TO", "REPLICATION", "RESET", "SET",
! 		 "SUPERUSER", "UNENCRYPTED", "VALID UNTIL", "WITH", NULL};
  
  		COMPLETE_WITH_LIST(list_ALTERUSER);
  	}
  
+ 	/* ALTER USER,ROLE <name> WITH */
+ 	else if ((pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
+ 			  (pg_strcasecmp(prev3_wd, "USER") == 0 ||
+ 			   pg_strcasecmp(prev3_wd, "ROLE") == 0) &&
+ 			  pg_strcasecmp(prev_wd, "WITH") == 0))
+ 	{
+ 		/* Similar to the above, but don't offer "WITH" as a suggestion. */
+ 		static const char *const list_ALTERUSER_WITH[] =
+ 		{"CONNECTION LIMIT", "CREATEDB", "CREATEROLE", "CREATEUSER",
+ 			"ENCRYPTED", "INHERIT", "LOGIN", "NOCREATEDB", "NOCREATEROLE",
+ 			"NOCREATEUSER", "NOINHERIT", "NOLOGIN", "NOREPLICATION",
+ 			"NOSUPERUSER", "RENAME TO", "REPLICATION", "RESET", "SET",
+ 		 "SUPERUSER", "UNENCRYPTED", "VALID UNTIL", NULL};
+ 
+ 		COMPLETE_WITH_LIST(list_ALTERUSER_WITH);
+ 	}
+ 
  	/* complete ALTER USER,ROLE <name> ENCRYPTED,UNENCRYPTED with PASSWORD */
  	else if (pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
  			 (pg_strcasecmp(prev3_wd, "ROLE") == 0 || pg_strcasecmp(prev3_wd, "USER") == 0) &&
*************** psql_completion(char *text, int start, i
*** 1947,1953 ****
  			 prev2_wd[0] != '\0')
  		COMPLETE_WITH_CONST("PROCEDURE");
  
! /* CREATE ROLE,USER,GROUP */
  	else if (pg_strcasecmp(prev3_wd, "CREATE") == 0 &&
  			 !(pg_strcasecmp(prev2_wd, "USER") == 0 && pg_strcasecmp(prev_wd, "MAPPING") == 0) &&
  			 (pg_strcasecmp(prev2_wd, "ROLE") == 0 ||
--- 1964,1970 ----
  			 prev2_wd[0] != '\0')
  		COMPLETE_WITH_CONST("PROCEDURE");
  
! /* CREATE ROLE,USER,GROUP <name> */
  	else if (pg_strcasecmp(prev3_wd, "CREATE") == 0 &&
  			 !(pg_strcasecmp(prev2_wd, "USER") == 0 && pg_strcasecmp(prev_wd, "MAPPING") == 0) &&
  			 (pg_strcasecmp(prev2_wd, "ROLE") == 0 ||
*************** psql_completion(char *text, int start, i
*** 1958,1968 ****
  			"ENCRYPTED", "IN", "INHERIT", "LOGIN", "NOCREATEDB",
  			"NOCREATEROLE", "NOCREATEUSER", "NOINHERIT", "NOLOGIN",
  			"NOREPLICATION", "NOSUPERUSER", "REPLICATION", "ROLE",
! 		"SUPERUSER", "SYSID", "UNENCRYPTED", "VALID UNTIL", NULL};
  
  		COMPLETE_WITH_LIST(list_CREATEROLE);
  	}
  
  	/*
  	 * complete CREATE ROLE,USER,GROUP <name> ENCRYPTED,UNENCRYPTED with
  	 * PASSWORD
--- 1975,2003 ----
  			"ENCRYPTED", "IN", "INHERIT", "LOGIN", "NOCREATEDB",
  			"NOCREATEROLE", "NOCREATEUSER", "NOINHERIT", "NOLOGIN",
  			"NOREPLICATION", "NOSUPERUSER", "REPLICATION", "ROLE",
! 		 "SUPERUSER", "SYSID", "UNENCRYPTED", "VALID UNTIL", "WITH", NULL};
  
  		COMPLETE_WITH_LIST(list_CREATEROLE);
  	}
  
+ /* CREATE ROLE,USER,GROUP <name> WITH */
+ 	else if ((pg_strcasecmp(prev4_wd, "CREATE") == 0 &&
+ 			  (pg_strcasecmp(prev3_wd, "ROLE") == 0 ||
+ 			   pg_strcasecmp(prev3_wd, "GROUP") == 0 ||
+ 			   pg_strcasecmp(prev3_wd, "USER") == 0) &&
+ 			  pg_strcasecmp(prev_wd, "WITH") == 0))
+ 	{
+ 		/* Similar to the above, but don't offer "WITH" as a suggestion. */
+ 		static const char *const list_CREATEROLE_WITH[] =
+ 		{"ADMIN", "CONNECTION LIMIT", "CREATEDB", "CREATEROLE", "CREATEUSER",
+ 			"ENCRYPTED", "IN", "INHERIT", "LOGIN", "NOCREATEDB",
+ 			"NOCREATEROLE", "NOCREATEUSER", "NOINHERIT", "NOLOGIN",
+ 			"NOREPLICATION", "NOSUPERUSER", "REPLICATION", "ROLE",
+ 		 "SUPERUSER", "SYSID", "UNENCRYPTED", "VALID UNTIL", NULL};
+ 
+ 		COMPLETE_WITH_LIST(list_CREATEROLE_WITH);
+ 	}
+ 
  	/*
  	 * complete CREATE ROLE,USER,GROUP <name> ENCRYPTED,UNENCRYPTED with
  	 * PASSWORD