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 1rcrVA-002YuO-7g for pgsql-admin@arkaria.postgresql.org; Wed, 21 Feb 2024 18:39:28 +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 1rcrV8-005tST-Ef for pgsql-admin@arkaria.postgresql.org; Wed, 21 Feb 2024 18:39:26 +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 1rcrV8-005tSJ-3k for pgsql-admin@lists.postgresql.org; Wed, 21 Feb 2024 18:39:26 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcrV1-000J8r-Ak for pgsql-admin@lists.postgresql.org; Wed, 21 Feb 2024 18:39:25 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 41LIdI3L095374; Wed, 21 Feb 2024 13:39:18 -0500 From: Tom Lane To: Nikhil Shetty cc: Pgsql-admin Subject: Re: Modify Bootstrap user ID In-reply-to: References: Comments: In-reply-to Nikhil Shetty message dated "Wed, 21 Feb 2024 23:47:30 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <95372.1708540758.1@sss.pgh.pa.us> Date: Wed, 21 Feb 2024 13:39:18 -0500 Message-ID: <95373.1708540758@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Nikhil Shetty writes: > We want to upgrade a postgres v13 database to v16. but the bootstrap user > used to initialise the database for both are different > Can we update the bootstrap user for v13 ? like assign oid as 10 in > pg_authid? Do not try to change role OIDs --- you will certainly miss some places where the OID appears. You can rename it though. You might have tried this: regression=# alter user postgres rename to pgsql; ERROR: session user cannot be renamed but it's easy to get around that: regression=# create user joe superuser; CREATE ROLE regression=# \c - joe You are now connected to database "regression" as user "joe". regression=# alter user postgres rename to pgsql; ALTER ROLE regression=# \c - pgsql You are now connected to database "regression" as user "pgsql". regression=# drop user joe; DROP ROLE regards, tom lane