Re: Report roles in pg_upgrade pg_ prefix check - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Report roles in pg_upgrade pg_ prefix check
Date
Msg-id Y4QMfaPRxpEyIgNy@paquier.xyz
Whole thread Raw
In response to Report roles in pg_upgrade pg_ prefix check  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: Report roles in pg_upgrade pg_ prefix check
List pgsql-hackers
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.

+       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.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: [BUG] FailedAssertion in SnapBuildPurgeOlderTxn
Next
From: Masahiko Sawada
Date:
Subject: Fix comment in SnapBuildFindSnapshot