Help Center/ Data Warehouse Service / Troubleshooting/ Account/Permission/Password/ An Error Message Is Reported During Statement Execution, Indicating that the User Does Not Have the Required Permission
Updated on 2025-09-19 GMT+08:00

An Error Message Is Reported During Statement Execution, Indicating that the User Does Not Have the Required Permission

Symptom

The following error message is displayed after statement execution.

1
ERROR:  permission denied for xxx

Possible Causes

The user does not have the corresponding permission and cannot access or perform operations on the table or schema.

Handling Procedure

  1. Grant permissions to tables or schemas using GRANT. If you want user jerry to have the query permission on all tables created by tom and the tables to be created, perform the following operations:

    • Assign the same schema permissions under user tom to jerry.
      1
      GRANT USAGE ON SCHEMA tom TO jerry;
      
    • Grant the select permission on the table created by user tom to jerry.
      1
      GRANT SELECT ON ALL TABLES IN SCHEMA tom TO jerry;
      
    • Grant select permission on tables created by user tom in the same schema to jerry.
      1
      ALTER DEFAULT PRIVILEGES FOR USER tom IN SCHEMA tom GRANT SELECT ON TABLES TO jerry;