Re: Report roles in pg_upgrade pg_ prefix check

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Report roles in pg_upgrade pg_ prefix check
Date: 2022-11-28 08:58:46
Message-ID: 1F9EB5F3-3BBD-46FF-9B0E-3877D837C9E2@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 28 Nov 2022, at 02:18, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Thu, Nov 24, 2022 at 12:31:09PM +0100, Daniel Gustafsson wrote:
>> Looking at a recent pg_upgrade thread I happened to notice that the check for
>> roles with a pg_ prefix only reports the error, not the roles it found. Other
>> similar checks where the user is expected to alter the old cluster typically
>> reports the found objects in a textfile. The attached adds reporting to make
>> that class of checks consistent (the check for prepared transactions which also
>> isn't reporting is different IMO as it doesn't expect ALTER commands).
>>
>> As this check is only executed against the old cluster the patch removes the
>> check when printing the error.
>
> +1. A backpatch would be nice, though not strictly mandatory as
> that's not a bug fix.

Yeah, it doesn't really qualify since this not a bugfix.

> + ntups = PQntuples(res);
> + i_rolname = PQfnumber(res, "rolname");
>
> Would it be worth adding the OID on top of the role name in the
> generated report? That would be a free meal.

We are a bit inconsistent in how much details we include in the report
textfiles, so could do that without breaking any consistency in reporting.
Looking at other checks, the below format would match what we already do fairly
well:

<rolname> (oid=<oid>)

Done in the attached.

--
Daniel Gustafsson https://vmware.com/

Attachment Content-Type Size
v2-0001-Report-incompatible-roles-in-pg_upgrade-checking.patch application/octet-stream 2.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2022-11-28 09:09:58 Failed Assert in pgstat_assoc_relation
Previous Message Thomas Munro 2022-11-28 08:53:59 Re: Understanding, testing and improving our Windows filesystem code