Allow system to start up, even if pg_auth_time_constraint is corrupt.
If pg_auth_time_constraint contains a role OID that doesn't exist in pg_authid, we used to crash at system startup. A corrupt catalog table is not good, but refusing to start up is even worse. Make write_auth_time_file() function more resilient, and throw a warning in that situation, and avoid the crash. The crash happened in the pq_qsort() after this loop, because time_name_compar expects every authtime_entry being sorted to have a valid non-NULL role name.
Showing
想要评论请 注册 或 登录