ALTER ROLE lets you securely change any ParadeDB user’s password on the fly.
Rotate credentials after staff turnover, suspected compromise, or on a regular security schedule. ParadeDB reuses PostgreSQL roles, so changing a password is identical to PostgreSQL.
Use ALTER ROLE role_name WITH PASSWORD 'new_secret' [VALID UNTIL 'YYYY-MM-DD']
. The command updates the encrypted password in pg_authid
immediately.
1. Connect as a superuser or a role with CREATEROLE
.
2.Run the ALTER ROLE
statement.
3. Test login with the new credentials.
4. Update environment variables or connection strings used by your app.
The ecommerce app stores data in Customers
, Orders
, Products
, and OrderItems
.The read-only role report_reader
powers dashboards.
-- connect as postgres
ALTER ROLE report_reader WITH PASSWORD 'GxY7!vL0$2024' VALID UNTIL '2025-01-01';
The role can now query tables such as SELECT COUNT(*) FROM Orders;
with the new password until the specified expiry date.
ParadeDB follows PostgreSQLs behavior: set VALID UNTIL
to a past date.Users must then change the password before reconnecting.
• Use long, random strings generated by a secrets manager.
• Add VALID UNTIL
for automatic expiry.
• Revoke unused roles with DROP ROLE
.
• Store credentials in Vault or AWS Secrets Manager, not in code.
Only superusers or roles granted CREATEROLE
can alter another roles password. A role can always change its own password.
Yes.Wrap several ALTER ROLE
commands in a single BEGIN; ... COMMIT;
block to maintain atomicity.
Missing quotes: Always quote the password string. Unquoted text is interpreted as identifiers.
Forgetting VALID UNTIL: Omitting expiration allows passwords to live forever and increases risk.
If a new password breaks your app, simply run ALTER ROLE
again with the old secret.No restart is needed.
Embed the command in CI/CD or Galaxy SQL editor snippets. Galaxys AI copilot can even generate the exact SQL for you.
See PostgreSQL docs: ALTER ROLE.
.
Yes. Any ParadeDB role can run ALTER ROLE CURRENT_USER WITH PASSWORD 'new'
to update its own credentials.
No. ALTER USER
is an exact synonym kept for historical reasons.
Existing sessions continue until they disconnect. New logins must use the updated password.