Updated on 2025-06-07 GMT+08:00

U0400004: The GaussDB view does not support SECURITY

Description

Database Type and Version

  • Source database type and version: MySQL 5.5, 5.6, 5.7, and 8.0
  • Target database type and version: all GaussDB versions

Syntax Example

This error is reported because UGO does not convert SECURITY by default.

SECURITY cannot be specified for GaussDB views, for example:

CREATE OR REPLACE SQL SECURITY DEFINER VIEW view_demo AS
SELECT * FROM emp_t WHERE deptno = 10;

Suggestion

Modify SQL SECURITY DEFINER.

In MySQL, SQL SECURITY DEFINER indicates that the object will use the privileges of its definer when being executed, and SQL SECURITY INVOKER indicates that the object will use the privileges of an invoker when being executed. SECURITY INVOKER is used in the default behavior of GaussDB. To replace it with SECURITY DEFINER, set GUC parameter behavior_compat_options to 'plsql_security_definer'. Fully understand and evaluate the impact of the difference between SECURITY INVOKER and SECURITY DEFINER. For details, see GaussDB Developer Guide.