Category: Blogs
Useful courses to develop Skill Set
Read More
How to Implement the Password Verify Function in a EDB PostgreSQL Advanced Server Database
Step 1: Create password verification function CREATE OR REPLACE FUNCTION sys.verify_password(user_name varchar2, new_password varchar2, old_password varchar)RETURNS boolean IMMUTABLELANGUAGE plpgsqlAS $function$BEGINIF (length(new_password) < 8)THEN— raise_application_error(-20001, ‘too short’);RAISE EXCEPTION ‘too short’;END IF;IF new_password= old_passwordTHEN— raise_application_error(-20002, ‘includes old password’);RAISE exception ‘includes old password’;END IF;IF substring(upper(new_password) FROM upper(user_name)) IS NOT NULLTHEN— raise_application_error(-20003, ‘New passowrd not allowed to include username’);RAISE […]