0

I want to know whether Postgres has a policy to lock a particular database user after several unauthorized login attempts.

amol
  • 1
  • 1
  • 2
  • 2
    No, nothing built-in (unless you externally authenticate e.g. using LDAP, PAM or [similar technologies](https://www.postgresql.org/docs/current/client-authentication.html)) –  Oct 09 '19 at 13:27

1 Answers1

1

You can write it using pluggins:

See https://wiki.postgresql.org/images/e/e3/Hooks_in_postgresql.pdf

There is a hook named ClientAuthentication_hook it is called after the login is checked and before the answer is sended to the client. There you can do what you want.

Emilio Platzer
  • 2,327
  • 21
  • 29