Use create role to set the password expiration interval for a new role.
This example creates the new role intern_role with the password “temp244”, and sets the password expiration interval for intern_role to 7 days:
create role intern_role with passwd "temp244", passwd expiration 7
For details on the syntax and rules for using passwd expiration, see create role.