Updated on 2024-06-03 GMT+08:00

CREATE WEAK PASSWORD DICTIONARY

Description

CREATE WEAK PASSWORD DICTIONARY creates a weak password dictionary, which is empty by default. You can use this syntax to add one or more weak passwords to the gs_global_config system catalog.

Precautions

  • Only the initial user, system administrator, and security administrator have the permission to execute this syntax.
  • Passwords in the weak password dictionary are stored in the gs_global_config system catalog.
  • The weak password dictionary is empty by default. You can use this syntax to add one or more weak passwords.
  • When a user attempts to execute this syntax to insert a weak password that already exists in the gs_global_config catalog, only one weak password is retained in the table.

Syntax

CREATE WEAK PASSWORD DICTIONARY
       [WITH VALUES] ( {'weak_password'} [, ...] );

Parameters

  • weak_password

    Specifies a weak password.

    Value range: a string.

Examples

-- Insert a single weak password into the gs_global_config system catalog.
gaussdb=# CREATE WEAK PASSWORD DICTIONARY WITH VALUES ('********');

-- Check weak passwords in the gs_global_config system catalog.
gaussdb=# SELECT * FROM gs_global_config WHERE NAME LIKE 'weak_password';
      name       |    value     
-----------------+--------------
 weak_password   | ********
(1 rows)

-- Insert multiple weak passwords into the gs_global_config system catalog.
gaussdb=# CREATE WEAK PASSWORD DICTIONARY WITH VALUES ('********'),('********');

-- Check the weak password in the gs_global_config system catalog again. The asterisk (*) in a weak password does not represent the password content.
gaussdb=# SELECT * FROM gs_global_config WHERE NAME LIKE 'weak_password';
      name       |     value      
-----------------+----------------
 weak_password   | ********
 weak_password   | ********
 weak_password   | ********
(3 rows)

-- Clear all weak passwords in the gs_global_config system catalog.
gaussdb=# DROP WEAK PASSWORD DICTIONARY;

-- View existing weak passwords.
gaussdb=# SELECT * FROM gs_global_config WHERE NAME LIKE 'weak_password';
 name | value 
------+-------
(0 rows)