Posts

Showing posts with the label Database configuration

Rails Postgresql Query timeout set and skip during migration

Hi, I am  Shubham Mishra  from India,  this is the part of  Ruby on Rails  exploration journey.  In this post we will discuss about the rails DB (Postgresql) query time out setting and how can we avoid this timeout setting during migration and I am sure you will get excited to make your hands dirty with those code, so why to wait let's get started... Question: Rails and postgresql I want to set query timeout to 10 sec but skip to check this timeout setting during rails migration how can i achieve? Answer: To set a query timeout of 10 seconds for PostgreSQL in a Rails application, you can use the statement_timeout configuration option in your database.yml file. Here is an example configuration that sets the query timeout to 10 seconds: This will set the query timeout to 10 seconds for all queries executed by the PostgreSQL adapter in the production environment. To skip checking the query timeout setting during Rails migrations, you can use a cust...