How Can I Create a Temporary 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.