RE: Update "usename" in pg_user

From: Bernd Lentes <bernd(dot)lentes(at)helmholtz-muenchen(dot)de>
To: Paul Smith* <paul(at)pscs(dot)co(dot)uk>, "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: RE: Update "usename" in pg_user
Date: 2023-11-14 13:20:10
Message-ID: PR3PR04MB7340875E4F0EE41F263D58D4D6B2A@PR3PR04MB7340.eurprd04.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

>>
>> update pg_user set usename = 'usename(at)helmholtz-munich(dot)de' where
>> usename = 'dorota.germann';
>
>1) don't update system tables directly unless you absolutely must

OK.

>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(dot)germann(at)helmholtz-
>munich.de";
>
>should do the job
>
>Paul

Hi Paul,

thanks. Can I do this for all users in one turn ?

Bernd

Helmholtz Zentrum München – Deutsches Forschungszentrum für Gesundheit und Umwelt (GmbH)
Ingolstädter Landstraße 1, D-85764 Neuherberg, https://www.helmholtz-munich.de
Geschäftsführung: Prof. Dr. med. Dr. h.c. Matthias H. Tschöp, Prof. Dr. Dr. h.c. mult. Martin Hrabě de Angelis (komm.) | Aufsichtsratsvorsitzende: MinDir’in Prof. Dr. Veronika von Messling
Registergericht: Amtsgericht München HRB 6466 | USt-IdNr. DE 129521671

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message David G. Johnston 2023-11-14 13:28:28 Re: Update "usename" in pg_user
Previous Message Paul Smith* 2023-11-14 13:05:15 Re: Update "usename" in pg_user