1

I have an app running Ruby on Rails, standard nothing fancy at all. Today when I was changing password in Postgresql I spot that app is still running with old credentials. This gives me time to rolling restart app with new db credentials. Open connections still work, because was authenticated with old credentials. How long Postgres will keep those connection active? I assume that there must be some time after client must re-authenticate. Where I can find more about it? Some setting? Tried to find something on https://www.postgresql.org/docs/9.5/static/runtime-config-connection.html but still don't know how it works in details.

  • afaik Password (authentication) check is only when connection starts. However authorization checks (ie table permissions) are valid when grant query ends. – Sahap Asci Aug 18 '17 at 8:17
3

A PostgreSQL instance will keep a client connection up and running until the connection either reaches a specified client timeout or the client (application) closes the connection.

A change of password has no effects on existing connections and will only affect new connections.

There is no mechanism that constantly checks if the connection is still "password valid". A client connection is a one time authentication and if it was valid at the time of authentication will keep on being valid until closed.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.