Re: Update "usename" in pg_user

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 14/11/2023 12:56, Bernd Lentes wrote:
Due to change of the LDAP server I need to modify the username now.
 From firstname.lastname to firstname.lastname@xxxxxxxxxxxxxxxxxxx.
I tried the following (just for one user to test it):

update pg_user set usename = 'usename@xxxxxxxxxxxxxxxxxxx' where usename = 'dorota.germann';

1) don't update system tables directly unless you absolutely must

ALTER USER <username> RENAME TO <new_username> is what you want

2) To use characters other than alphanumeric or _ then you need to use double quotes


So:

ALTER USER dorota.germann RENAME TO "dorota.germann@xxxxxxxxxxxxxxxxxxx";

should do the job

Paul






[Index of Archives]     [Postgresql Home]     [Postgresql General]     [Postgresql Performance]     [Postgresql PHP]     [Postgresql Jobs]     [PHP Users]     [PHP Databases]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Forum]

  Powered by Linux