All Products
Search
Document Center

PolarDB:ALTER PROFILE

Last Updated:Mar 28, 2026

Modifies an existing profile in PolarDB for PostgreSQL (Compatible with Oracle).

Syntax

ALTER PROFILE profile_name RENAME TO new_name;

ALTER PROFILE profile_name
      LIMIT {parameter value}[...];

Description

ALTER PROFILE supports two forms:

  • RENAME TO — renames a profile.

  • LIMIT — modifies the password and account-lockout rules enforced by the profile. Include one or more space-delimited parameter value pairs after the LIMIT keyword.

Parameters

ParameterDescription
profile_nameThe name of the profile to modify.
new_nameThe new name for the profile (used with RENAME TO).
parameterA LIMIT parameter name. See the supported parameters below.
valueThe value to assign to the parameter.

Supported LIMIT parameters

FAILED_LOGIN_ATTEMPTS

Specifies the maximum number of failed logon attempts before the server locks the account for the duration set by PASSWORD_LOCK_TIME.

ValueDescription
INTEGER > 0Maximum number of failed attempts.
DEFAULTUses the value set in the DEFAULT profile.
UNLIMITEDNo limit on failed attempts.

PASSWORD_LOCK_TIME

Specifies how long the server keeps an account locked after too many failed logon attempts.

ValueDescription
NUMERIC >= 0Number of days. Use a decimal to specify fractional days (for example, 4.5 = 4 days and 12 hours).
DEFAULTUses the value set in the DEFAULT profile.
UNLIMITEDThe account stays locked until a database superuser unlocks it.

PASSWORD_LIFE_TIME

Specifies how many days a password remains valid before the user must set a new one. Combine with PASSWORD_GRACE_TIME to allow a grace period after expiry.

If PASSWORD_GRACE_TIME is not set, the server uses the default value from the DEFAULT profile. After the grace period ends, the user can still connect but cannot run any command until the password is changed.

ValueDescription
NUMERIC >= 0Number of days. Use a decimal for fractional days.
DEFAULTUses the value set in the DEFAULT profile.
UNLIMITEDThe password never expires.

PASSWORD_GRACE_TIME

Specifies the grace period after a password expires until the user is required to change the password. After the grace period ends, the user is allowed to connect to the server but cannot run any command until the expired password is updated.

ValueDescription
NUMERIC >= 0Number of days. Use a decimal for fractional days.
DEFAULTUses the value set in the DEFAULT profile.
UNLIMITEDThe grace period has no end date.

PASSWORD_REUSE_TIME

Specifies the number of days a user must wait before reusing a password. Must be used together with PASSWORD_REUSE_MAX.

  • If one parameter has a finite value and the other is UNLIMITED, previous passwords cannot be reused.

  • If both are UNLIMITED, no reuse restriction applies.

ValueDescription
NUMERIC >= 0Number of days. Use a decimal for fractional days.
DEFAULTUses the value set in the DEFAULT profile.
UNLIMITEDNo waiting period for password reuse.

PASSWORD_REUSE_MAX

Specifies how many password changes must occur before a password can be reused. Must be used together with PASSWORD_REUSE_TIME. The same UNLIMITED interaction rules as PASSWORD_REUSE_TIME apply.

ValueDescription
INTEGER > 0Number of password changes required.
DEFAULTUses the value set in the DEFAULT profile.
UNLIMITEDNo limit on password reuse.

PASSWORD_VERIFY_FUNCTION

Specifies a PL/SQL function used to validate password complexity.

ValueDescription
Function nameThe name of a PL/SQL function.
DEFAULTUses the function set in the DEFAULT profile.
NULLDisables password complexity verification.

PASSWORD_ALLOW_HASHED

Specifies whether the server accepts a pre-hashed password from the client.

  • TRUE / ON / YES / 1 — allows the client to supply a pre-hashed password.

  • FALSE / OFF / NO / 0 — requires a plain-text password. The server returns an error if it receives a hashed password.

ValueDescription
Boolean (TRUE/ON/YES/1 or FALSE/OFF/NO/0)Whether to allow hashed passwords.
DEFAULTUses the value set in the DEFAULT profile.
Note

PASSWORD_ALLOW_HASHED is not supported by Oracle.

Examples

Limit failed logon attempts and set a lockout period

The following example modifies acctg_profile so that after 3 consecutive failed logon attempts, the account is locked for 1 day.

ALTER PROFILE acctg_profile
       LIMIT FAILED_LOGIN_ATTEMPTS 3 PASSWORD_LOCK_TIME 1;

Rename a profile

The following example renames acctg_profile to payables_profile.

ALTER PROFILE acctg_profile RENAME TO payables_profile;