On 30.12.2023 17:33, Isaac Morland wrote:
Would it make sense to make the column non-nullable and always set it to infinity when there is no expiry?

A password is not required for roles. In many cases, external authentication is used in ph_hba.conf.
I think it would be strange to have 'infinity' for roles without a password.

Tom suggested to have 'infinity' in the \du output for roles with a password. My doubt is that this will hide the real values (absence of values). So I suggested a separate column 'Has password?' to show roles with password and unmodified column 'Password expire time'.

Yes, it's easy to replace NULL with "infinity" for roles with a password, but why? What is the reason for this action? Absence of value for 'expire time' clear indicates that there is no time limit. Also I don't see a practical reasons to execute next command, since it do nothing:

ALTER ROLE .. PASSWORD 'infinity';

So I think that in most cases there is no "infinity" in the rolvaliduntil column.

But of course, I can be wrong.

Thank you for giving your opinion.

--
Pavel Luzanov
Postgres Professional:https://postgrespro.com

Reply via email to