By tabarnapp
We are trying to refresh a materialised view that is going to take roughly 20 to 30 minutes because of huge data set. Since refresh view query does not return anyting so connection is forcefully being killed/closed by managed postgres 11 databaes with the following error message.
FATAL: terminating connection due to administrator command
SSL connection has been closed unexpectedly
The connection to the server was lost. Attempting reset: Succeeded.
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
We have tried a lot (eg. I have tried to connect connect via bare postgres-client and ran the commands there by bypassing any GUI tool and app ORM etc.) and nothing sounds working at all. Can you please help us in this regard.
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.
To help mitigate this issue, you can try increasing the statement_timeout and idle_in_transaction_session_timeout in your PostgreSQL configuration. This can be done through the DigitalOcean Control Panel under the database’s Settings tab by modifying the respective settings values.
If you’re still experiencing issues after adjusting the timeouts, you might consider breaking down the refresh operation into smaller data chunks to better manage the process timeframe.
For additional information, please refer to the DigitalOcean docs on PostgreSQL.
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.