mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Add passwordcheck.min_password_length.
This new parameter can be used to change the minimum allowed password length (in bytes). Note that it has no effect if a user supplies a pre-encrypted password. Author: Emanuele Musella, Maurizio Boriani Reviewed-by: Tomas Vondra, Bertrand Drouvot, Japin Li Discussion: https://postgr.es/m/CA%2BugDNyYtHOtWCqVD3YkSVYDWD_1fO8Jm_ahsDGA5dXhbDPwrQ%40mail.gmail.com
This commit is contained in:
@ -6,6 +6,10 @@ ALTER USER regress_passwordcheck_user1 PASSWORD 'a_nice_long_password';
|
||||
-- error: too short
|
||||
ALTER USER regress_passwordcheck_user1 PASSWORD 'tooshrt';
|
||||
ERROR: password is too short
|
||||
DETAIL: password must be at least "passwordcheck.min_password_length" (8) bytes long
|
||||
-- ok
|
||||
SET passwordcheck.min_password_length = 6;
|
||||
ALTER USER regress_passwordcheck_user1 PASSWORD 'v_shrt';
|
||||
-- error: contains user name
|
||||
ALTER USER regress_passwordcheck_user1 PASSWORD 'xyzregress_passwordcheck_user1';
|
||||
ERROR: password must not contain user name
|
||||
|
@ -6,6 +6,10 @@ ALTER USER regress_passwordcheck_user1 PASSWORD 'a_nice_long_password';
|
||||
-- error: too short
|
||||
ALTER USER regress_passwordcheck_user1 PASSWORD 'tooshrt';
|
||||
ERROR: password is too short
|
||||
DETAIL: password must be at least "passwordcheck.min_password_length" (8) bytes long
|
||||
-- ok
|
||||
SET passwordcheck.min_password_length = 6;
|
||||
ALTER USER regress_passwordcheck_user1 PASSWORD 'v_shrt';
|
||||
-- error: contains user name
|
||||
ALTER USER regress_passwordcheck_user1 PASSWORD 'xyzregress_passwordcheck_user1';
|
||||
ERROR: password must not contain user name
|
||||
|
Reference in New Issue
Block a user