how do you find a locked account?

Level 2 Adventurer

how do you find a locked account?

Problem: How do you veriy an account is no longer a locked account?



EDB AS the view DBA_TABLES. It uses a function, edb_get_role_status() to get the account status for the user.


Where would I find a list of locked users in the pg_ tables? 


I see rollockdate in pg_authid but that field is still populated when I unlock an account. 



Archived Discussions

Effective March 31st, we will no longer engage on PostgresRocks.

How to engage with us further?

  • Thought Leadership: EDB Blogs

  • Tips and Tricks: Postgres Tutorials

  • Customer Support: Create a Case Please note: Only customers with an active EDB support subscription and support portal authorization can create support ticket

  • Engage on Stackoverflow While engaging on Stackoverflow tag the question with EDB or EnterpriseDB.


Re: how do you find a locked account?

Hi Mediis,


Could you clarify what a "locked user" is?  If you are meaning a user who cannot log in via psql or some other client, you'll need to look in rolcanlogin.  This is set via the CONNECT privilege in the GRANT command.  More information can be found at (


Please let me know if you need any further assistance!

Silver Adventurer

Re: how do you find a locked account?



EDB AS is designed to support Oracle compatibile features. Hence, EDB AS is having user locking concept, which can be viewed in dba_users(column account_status) view. Here, dba_users view is provisioned as part of Oracle compatibiliy.


Now, pg_user is PostgreSQL standard view. And, PostgreSQL doesn't have concept of locking/unlocking user. So, It's not feasible to find user lock status in pg_user view. However, If user password expiring is set then It is visible in pg_user(column valuntil).


Thanks & Regds,

Ninad Shah

© 2019 EnterpriseDB Corporation. All rights reserved.   |   Privacy Policy   |  Terms of Use   |   Trademarks