pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jim Wilson <jim@wreath.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: Feature bug dumpall CREATE ROLE postgres
Date: Tue, 27 Feb 2024 15:12:42 -0500
Message-ID: <2149099.1709064762@sss.pgh.pa.us> (raw)
In-Reply-To: <CABboei8cKxParK=nGwjHp0i=5xdn9YtkUQAo=_vuGm-F8X46gw@mail.gmail.com>
References: <CABboei8cKxParK=nGwjHp0i=5xdn9YtkUQAo=_vuGm-F8X46gw@mail.gmail.com>

Jim Wilson <jim@wreath.com> 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





view thread (9+ messages)  latest in thread

Message-ID: <2149099.1709064762@sss.pgh.pa.us>
Permalink:  ../2149099.1709064762@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2149099.1709064762@sss.pgh.pa.us

 · 

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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jim@wreath.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: Feature bug dumpall CREATE ROLE postgres
  In-Reply-To: <2149099.1709064762@sss.pgh.pa.us>

* 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