Alter an user in postgres
-- Rename a user:
postgresql configurationintermediate
by PostgreSQL
11 views
-- Rename a user:
123456789101112131415161718
postgres=#
alter user dbatest rename to dbaprod;
NOTICE: MD5 password cleared because of role rename
ALTER ROLE
postgres=#
\du
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------------------+-----------
dbaprod | | {}
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
<< NOTE - AFTER renaming the user, you need to reset the password to same old one.
postgres=#
alter user dbaprod password 'test';
ALTER ROLE
postgres=#
alter user dbaprod valid until 'Feb 10 2021';
ALTER ROLEPlease to add comments
No comments yet. Be the first to comment!