I have Managed Postgres instance, and a query that stops after 10 minutes.
The query is REFRESH MATERIALIZED VIEW xyz.
I kind looks like there is a limit for a query to run for 10 minutes. Can anyone tell what particular limit might come into play here?
The instance is 1 GB RAM / 1vCPU / 10 GB Disk / Primary only / FRA1.
The application is running spring boot and the Hikari connection pool.
First error message is 'SQLSTATE(57P01), ErrorCode(0)'
Second: FATAL: terminating connection due to administrator command; nested exception is org.postgresql.util.PSQLException: FATAL: terminating connection due to administrator command
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Heya,
Just came across this answer and decided to write some general guidelines for anyone who comes across this in the future despite the old question.
Queries in Managed Databases are allowed to run indefinitely as long as they’re not consuming resources to the point where it harms the server or other databases.
SQLSTATE(57P01) usually means that an administrator (or automatic system) had to kill your query, either because it was taking too long or using too many resources. In your case with a 1GB RAM / 1vCPU Postgres instance, running a resource-intensive query like REFRESH MATERIALIZED VIEW might be too taxing on your server, especially if there are other operations happening concurrently.
You could consider upgrading your server, optimizing your query, or performing the operation in chunks if it’s feasible to do so. For more insights, you may refer to # How to Monitor PostgreSQL Database Performance.
Hope that this helps!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.