php8.5
Home/ Manual/ pgsql / functions/ pg_change_password

pg_change_password

PHP function Edit on GitHub ✎

(PHP 8 >= 8.4.0)

Change a PostgreSQL user's password

Description

pg_change_password(PgSql\Connection $connection, string $user, string $password): bool

pg_change_password() changes the password of a PostgreSQL user. This function uses the PQchangePassword libpq function which handles password encryption automatically based on the server's settings.

Parameters

connection

Connection

user

The name of the PostgreSQL user whose password to change.

password

The new password.

Return Values

Success

See Also

Source: reference/pgsql/functions/pg-change-password.xml · from the official PHP manual (php/doc-en)