How Can I Create a Temporary Password When I create a new user, I give them a "temporary" password and tell them to change it as soon as they log in. How can I effectively enforce this?

I tried using ALTER USER VALID UNTIL 'near-future-timestamp'; but as it turns out this expiration date does not get reset when the user changes their password.
I don't think you can by using PostgreSQL internal authentication.

Check https://www.postgresql.org/message-id/4836F43E.4050607@otg-nc.com:


  I think the best you could do would be to tie authentication into some 
  external system that requires a password change after a specified 
  interval.  This can be accomplished with LDAP, Kerberos, or PAM.
  However, I don't think that the native mechanism will allow you to do 
  what you are trying to accomplish.


This is rather old, but, AFAIK it's still valid.