2017-11-02 17:56:30 +01:00
|
|
|
LOAD 'passwordcheck';
|
2022-10-05 19:43:13 +02:00
|
|
|
CREATE USER regress_passwordcheck_user1;
|
2017-08-12 03:04:04 +02:00
|
|
|
-- ok
|
2022-10-05 19:43:13 +02:00
|
|
|
ALTER USER regress_passwordcheck_user1 PASSWORD 'a_nice_long_password';
|
2017-08-12 03:04:04 +02:00
|
|
|
-- error: too short
|
2022-10-05 19:43:13 +02:00
|
|
|
ALTER USER regress_passwordcheck_user1 PASSWORD 'tooshrt';
|
2017-08-12 03:04:04 +02:00
|
|
|
ERROR: password is too short
|
|
|
|
-- error: contains user name
|
2022-10-05 19:43:13 +02:00
|
|
|
ALTER USER regress_passwordcheck_user1 PASSWORD 'xyzregress_passwordcheck_user1';
|
2017-08-12 03:04:04 +02:00
|
|
|
ERROR: password must not contain user name
|
|
|
|
-- error: contains only letters
|
2022-10-05 19:43:13 +02:00
|
|
|
ALTER USER regress_passwordcheck_user1 PASSWORD 'alessnicelongpassword';
|
2017-08-12 03:04:04 +02:00
|
|
|
ERROR: password must contain both letters and nonletters
|
|
|
|
-- encrypted ok (password is "secret")
|
2022-10-05 19:43:13 +02:00
|
|
|
ALTER USER regress_passwordcheck_user1 PASSWORD 'md592350e12ac34e52dd598f90893bb3ae7';
|
2017-08-12 03:04:04 +02:00
|
|
|
-- error: password is user name
|
2022-10-05 19:43:13 +02:00
|
|
|
ALTER USER regress_passwordcheck_user1 PASSWORD 'md507a112732ed9f2087fa90b192d44e358';
|
2017-08-12 03:04:04 +02:00
|
|
|
ERROR: password must not equal user name
|
2022-10-05 19:43:13 +02:00
|
|
|
DROP USER regress_passwordcheck_user1;
|