Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r2t6j-001FPh-Q5 for pgsql-admin@arkaria.postgresql.org; Tue, 14 Nov 2023 13:05:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r2t6i-007U5f-6e for pgsql-admin@arkaria.postgresql.org; Tue, 14 Nov 2023 13:05:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r2t6h-007U5X-Ke for pgsql-admin@lists.postgresql.org; Tue, 14 Nov 2023 13:05:31 +0000 Received: from mail2.pscs.co.uk ([178.159.10.131] helo=mail.pscs.co.uk) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r2t6e-006OIo-QH for pgsql-admin@lists.postgresql.org; Tue, 14 Nov 2023 13:05:30 +0000 Authentication-Results: mail.pscs.co.uk; spf=none; auth=pass (cram-md5) smtp.auth=pscs Received: from lmail.pscs.co.uk ([192.168.120.1]) by mail.pscs.co.uk ([192.168.120.185] running VPOP3) with ESMTPSA (TLSv1.3 TLS_AES_256_GCM_SHA384) for ; Tue, 14 Nov 2023 13:05:25 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pscs.co.uk; q=dns/txt; s=lmail; h=Message-ID:Date:MIME-Version:Subject:To:References:From:In-Reply-To :Content-Type:Content-Transfer-Encoding:Cc:Reply-to:Sender; t=1699967115; x=1700571915; bh=DkHNbRSNNHG6qOVIoSLiDGW1wnh3QdkGUOer1RsLZ4w=; b=oBj+g2gQLLCMyrPK4VaFMHxTtulA3XIH0aVkGnMpUyICydT+jjwbxPVHwDKJ3/287o0sOJgs p3aNYwlHEMgrhih1pRZHxubS2apsuKVj/G3JYTwAJOPmz0rLtBgyHQaqYt2msvKt6ffvQS5zAB kkuNT+MrRM5p9//rWEMdnLrtc= Authentication-Results: lmail.pscs.co.uk; spf=none; auth=pass (cram-md5) smtp.auth=paul Received: from [192.168.57.78] ([82.68.48.206] (82-68-48-206.dsl.in-addr.zen.co.uk)) by lmail.pscs.co.uk ([192.168.120.70] running VPOP3) with ESMTPSA (TLSv1.3 TLS_AES_256_GCM_SHA384) for ; Tue, 14 Nov 2023 13:05:15 -0000 Message-ID: <79d4ec67-40b2-427f-aa40-2588bacb4556@pscs.co.uk> Date: Tue, 14 Nov 2023 13:05:15 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Update "usename" in pg_user Content-Language: en-GB To: pgsql-admin@lists.postgresql.org References: From: Paul Smith* In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-Sender: paul X-Server: VPOP3 Enterprise V8.5 - Registered X-Organisation: Paul Smith Computer Services X-VPOP3Tester: 12 345 X-Authenticated-Sender: pscs List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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@helmholtz-munich.de. > I tried the following (just for one user to test it): > > update pg_user set usename = 'usename@helmholtz-munich.de' where usename = 'dorota.germann'; 1) don't update system tables directly unless you absolutely must ALTER USER RENAME TO 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