Hi,
I've been told by my company's DBA that we should look into setting `
statement_timeout` on our Postgres connections. In a nutshell, this is a configuration option that will time out any individual statement that takes longer than this value (in ms). It seems like we can set this with a simple statement like this:
set statement_timeout=600000;
I'm not sure where this statement would go... Any suggestions there? I guess we should just run it with `execute` soon after the database connection is established, but I'm not sure if there's some sort of hook to run code like this upon database connection.
(The other option is to just set it for the entire Postgres DB -- however, our DBA advised that this setting should be handled at the app end for effective connection handling.)
Does this seem like something that would be useful to go into Postgrex itself? There are already options such as timeout, connect_timeout, etc. so to me it would make sense if `statement_timeout` was added as another configurable option.