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