TEC614779: Postgres Vacuum command fails and gives a Timeout error.

Document created by Tom_Wyszomierski Employee on May 25, 2016Last modified by SamCreek on May 25, 2016
Version 2Show Document
  • View in full screen mode

Author: Tom_Wyszomierski


Document ID:  TEC614779

Last Modified Date:  7/30/2014

  • Products
    • CA Application Performance Management
  • Components


Description:This article reviews the Error: "vacuumdb: vacuuming of database "cemdb" failed: ERROR: canceling statement due to statement timeout", when running the Vacuum command on a Postgres database(s).Solution:When the vacuumdb command runs, it connects to the database and then executes a VACUUM statement. If that statement processes longer than the configured statement timeout value for that database, then the command is canceled, and the above error is logged. To avoid this error, try the following:

  1. Change the statement_timeout parameter in postgresql.conf and reload the configuration to run vacuumdb. This is not recommended because it affects all future sessions.

    To reload the configuration, use the command:

    postgres=# select pg_reload_conf();


  2. Establish a connection through psql or pgadmin and execute SET statement_timeout = 0; before issuing a VACUUM statement on that connection.

    A timeout of 0 disables this setting. You can also set a statement timeout value. This configured statement timeout value is in milliseconds. To check the value set for this parameter, use the command:

    postgres=# show statement_timeout;



Search the Entire CA APM Knowledge Base