pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bernd Lentes <bernd.lentes@helmholtz-muenchen.de>
To: Paul Smith* <paul@pscs.co.uk>
To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: RE: Update "usename" in pg_user
Date: Tue, 14 Nov 2023 13:20:10 +0000
Message-ID: <PR3PR04MB7340875E4F0EE41F263D58D4D6B2A@PR3PR04MB7340.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <79d4ec67-40b2-427f-aa40-2588bacb4556@pscs.co.uk>
References: <PR3PR04MB73409EB3F2695DA61418F784D6B2A@PR3PR04MB7340.eurprd04.prod.outlook.com>
	<79d4ec67-40b2-427f-aa40-2588bacb4556@pscs.co.uk>

>>
>> update pg_user set usename = 'usename@helmholtz-munich.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.germann@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


view thread (10+ messages)  latest in thread

Message-ID: <PR3PR04MB7340875E4F0EE41F263D58D4D6B2A@PR3PR04MB7340.eurprd04.prod.outlook.com>
Permalink:  ../PR3PR04MB7340875E4F0EE41F263D58D4D6B2A@PR3PR04MB7340.eurprd04.prod.outlook.com/
Also on:    postgresql.org/message-id/PR3PR04MB7340875E4F0EE41F263D58D4D6B2A@PR3PR04MB7340.eurprd04.prod.outlook.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: bernd.lentes@helmholtz-muenchen.de, paul@pscs.co.uk, pgsql-admin@lists.postgresql.org
  Subject: RE: Update "usename" in pg_user
  In-Reply-To: <PR3PR04MB7340875E4F0EE41F263D58D4D6B2A@PR3PR04MB7340.eurprd04.prod.outlook.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox