sqlpostgresqlpgagent

postgresql lock user without activity


I have to lock users who don t work in the previous three months. I'm very newbie! I looked at the documentation and I do nt think I can do this by configuration. (Is it true?) So I have to develop a daily procedure ( with pgagent?) ,make a query and then lock users but I cant find a system table that has this information. Could you help me? Thanks a lot Gian


Solution

  • That is correct, the time of the last login is not recorded in the database, only in the log file (if logging is suitably configured).

    I think you won't be able to implement this without the aid of the application that uses PostgreSQL. I can think of two possibilities:

    Unfortunately there is no such thing as a “login trigger” is PostgreSQL, that would make this much simpler.