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 1rf3oo-00FBgp-M1 for pgsql-bugs@arkaria.postgresql.org; Tue, 27 Feb 2024 20:12:51 +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 1rf3on-005u5w-1A for pgsql-bugs@arkaria.postgresql.org; Tue, 27 Feb 2024 20:12:49 +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 1rf3om-005u4l-PH for pgsql-bugs@lists.postgresql.org; Tue, 27 Feb 2024 20:12:49 +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 1rf3of-001aY8-UO for pgsql-bugs@lists.postgresql.org; Tue, 27 Feb 2024 20:12:47 +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 41RKCgMH2149100; Tue, 27 Feb 2024 15:12:42 -0500 From: Tom Lane To: Jim Wilson cc: pgsql-bugs@lists.postgresql.org Subject: Re: Feature bug dumpall CREATE ROLE postgres In-reply-to: References: Comments: In-reply-to Jim Wilson message dated "Tue, 27 Feb 2024 12:26:38 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2149098.1709064762.1@sss.pgh.pa.us> Date: Tue, 27 Feb 2024 15:12:42 -0500 Message-ID: <2149099.1709064762@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jim Wilson writes: > Including "CREATE ROLE postgres;" in the dumpall will cause the script to > throw an error. I believe the reason pg_dumpall does that is to avoid worse failures if the target installation has a different bootstrap superuser name than the source did. One error is easier to ignore than hundreds of 'em. We could avoid that problem if we wanted to invent and use CREATE OR REPLACE ROLE, but that would have downsides of its own, such as silently overwriting the properties of any roles that already exist in the target (IOW, the cases where you *want* to get that error). Maybe it'd work to invent C.O.R.R. but only use it for the bootstrap superuser, with plain CREATE ROLE for the rest. Haven't really thought through the consequences of that. regards, tom lane