Re: pg_dumpall -r -c try to drop user postgres

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_dumpall -r -c try to drop user postgres
Date: 2017-12-03 22:48:29
Message-ID: CAB7nPqT6m8gyZFbsRFk1j52R55VVrdxB9dMFFRWi4ukRnTxa+g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Dec 3, 2017 at 3:21 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
> I am not sure if user postgres should be removed, so it is probably bug
>
> pg_dumpall -r -c | grep postgres
>
> DROP ROLE postgres;
> CREATE ROLE postgres;

You are looking for this bit of code:
/*
* If asked to --clean, do that first. We can avoid detailed
* dependency analysis because databases never depend
on each other,
* and tablespaces never depend on each other. Roles could have
* grants to each other, but DROP ROLE will clean
those up silently.
*/
if (output_clean)
{
if (!globals_only && !roles_only && !tablespaces_only)
dropDBs(conn);

if (!roles_only && !no_tablespaces)
dropTablespaces(conn);

if (!tablespaces_only)
dropRoles(conn);
}
Could you clarify what you think is wrong here?
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-12-03 23:08:46 Re: Bitmap scan is undercosted?
Previous Message Deep-Impact 2017-12-03 22:35:55 Re: [RFC] What would be difficult to make data models pluggable for making PostgreSQL a multi-model database?