On 18th of November Tom Lane committed patch by Laurenz Albe which adds very interesting capability:
Add a hook to CREATE/ALTER ROLE to allow an external module to check the strength of database passwords, and create a sample implementation of such a hook as a new contrib module "passwordcheck". Laurenz Albe, reviewed by Takahiro Itagaki
Continue reading Waiting for 8.5 – checking password strength