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 1r2x5E-001WoP-CH for pgsql-admin@arkaria.postgresql.org; Tue, 14 Nov 2023 17:20:16 +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 1r2x5D-009nUR-0u for pgsql-admin@arkaria.postgresql.org; Tue, 14 Nov 2023 17:20:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r2x5B-009nUB-Br for pgsql-admin@lists.postgresql.org; Tue, 14 Nov 2023 17:20:14 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r2x58-005ZIT-Jf for pgsql-admin@lists.postgresql.org; Tue, 14 Nov 2023 17:20:12 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 698C95C0277; Tue, 14 Nov 2023 12:20:09 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 14 Nov 2023 12:20:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1699982409; x= 1700068809; bh=LZc7qV4azHzzqlSh9HMr8SF3p+a9xwVQ0WfrLLddBFE=; b=b kmw26SqKup5LbadDO81PbgGfiELMlntasL82g9WNGdo37u/pcbU2V/RcQKC4Si+5 /ryQt3qpbAJnGx3a0XO37rwd65mVEWaxYI/eO+112B/u4g73qEImZSBPM3SbcJ6x IMswjca2V2fx+NxbBckONZ4p6f0dA5t/w4gmgBOZkjzPu35BJs42/EQkqEEyDZ5k DXslYBfeY8+C/ksZ7gZgdvwR9A/TVXZgfy5f9zxHrrbK9aewUu6wexOA3rQn9MCO EcrsjemyYL5tduM+EBIN34nOGZPr6NZYRYNP3p1qcRN4xdtTkerrOeWA3o01MxfA yg1Ck1sRfHqcRxNbpYINw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudeffedgtdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffhjeejhffgieeuueekjeek fffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Nov 2023 12:20:08 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1699982406; bh=w8zM2ntKwpi+DI1Vdx6/xvwMh519tZtrtSkPj3ErjMw=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=QS2VzKlTTAPns4mGmVAx9w8OndyTieayV1NK/uKkPGUHGwCVmAMsociu/nZy16QKa Twd/siPQSNDNBy40d75CqZjglloR5B8QrxcHjwGYb9dVE9DMu/L2V/4kVLlUlt0Hpt bJUzgrOyJmcBukFzG16hYYP/YxHCqmDmn75UOX9ut3Eo5pd0WQePUw9r0HGyNjx08R CutS408EJDOis2/O1VaXEub7C9X3f/+GoWkZHoCinXwtc4q6wQMYzR6E6srjEBi4CO k/ZPvJ/uR039m/ZVOPS+TGqC5gmqjSIfmndlYj2X0uPKTUTc+CyxqVE68qZ8EocRLM eeN4CnR73PHAA== Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 0DA2FDE; Tue, 14 Nov 2023 18:20:06 +0100 (CET) Date: Tue, 14 Nov 2023 18:20:06 +0100 From: Alvaro Herrera To: Bernd Lentes Cc: Pgsql-admin Subject: Re: Update "usename" in pg_user Message-ID: <202311141720.u7gf2homkhst@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-Nov-14, Bernd Lentes wrote: > It didn't work. I got this message (unfortunately in german): > postgres=# update pg_user set usename = 'usename@helmholtz-munich.de' where usename = 'dorota.germann'; > FEHLER: kann Sicht »pg_shadow« nicht aktualisieren > DETAIL: Sichten, die nicht aus einer einzigen Tabelle oder Sicht lesen, sind nicht automatisch aktualisierbar. > HINT: Um Aktualisieren der Sicht zu ermöglichen, richten Sie einen INSTEAD OF UPDATE Trigger oder eine ON UPDATE DO INSTEAD Regel ohne Bedingung ein. This error says that you're trying to update a view (Sicht), and suggesting to update the underlying table instead. So you would update pg_authid, which is the table that the pg_user and pg_shadow views are based on (and the column would be "rolname", not "usename"). Also, you probably wanted the SET clause as SET usename = usename || '@helmholtz-munich.de' otherwise all users would end up with the same username (or actually got an error that the second user would get a duplicate name). However, using UPDATE (or any DML) on system catalogs is not a great move. Using \gexec as already suggested by Laurenz is probably your best bet. BTW, you can use SET lc_messages to "C"; before the UPDATE to get these error messages in English. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "The Postgresql hackers have what I call a "NASA space shot" mentality. Quite refreshing in a world of "weekend drag racer" developers." (Scott Marlowe)