Help Center> GaussDB(DWS)> Troubleshooting> Database Use> An Error Is Reported When the truncate Command Is Executed on the System Table pg_catalog.gs_wlm_session_info
Updated on 2024-03-08 GMT+08:00

An Error Is Reported When the truncate Command Is Executed on the System Table pg_catalog.gs_wlm_session_info

Symptom

The size of the system table pg_catalog.gs_wlm_session_info is large (about 20 GB). When the truncate command is executed on the system table without querying historical SQL statements, "permission denied for relation gs_wlm_session_info" is reported.

Possible Causes

Only clusters of version 8.x or later support the truncate command for system tables.

To view the cluster version, log in to the GaussDB (DWS) management console, and go to the Clusters page. Click the name of the target cluster and view the version in the Basic Information page.

Handling Procedure

  • To clear system tables for cluster versions earlier than 8.0, run DELETE FROM and then VACUUM FULL.

    The following uses the gs_wlm_session_info system table as an example:

    1
    2
    DELETE FROM pg_catalog.gs_wlm_session_info;
    VACUUM FULL pg_catalog.gs_wlm_session_info;
    
  • For clusters of version 8.0 or later, run the following command to clear system tables:
    1
     TRUNCATE TABLE dbms_om.gs_wlm_session_info;
    

    This system table schema in this example is dbms_om.