improve more permissions-related error messages

Lists: pgsql-hackers
From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: improve more permissions-related error messages
Date: 2023-05-12 20:37:21
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

This is intended as a follow-up to de4d456 [0]. I noticed that c3afe8c
introduced another "must have privileges" error message that I think should
be adjusted to use the new style introduced in de4d456. І've attached a
small patch for this.

While looking around for other such error messages, I found a few dozen
"must be superuser" errors that might be improved with the new style. If
folks feel this is worthwhile, I'll put together a patch.

[0] https://postgr.es/m/20230126002251.GA1506128%40nathanxps13

--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
improve_errmsg.patch text/x-diff 1.7 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: improve more permissions-related error messages
Date: 2023-05-12 20:43:08
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Nathan Bossart <nathandbossart(at)gmail(dot)com> writes:
> This is intended as a follow-up to de4d456 [0]. I noticed that c3afe8c
> introduced another "must have privileges" error message that I think should
> be adjusted to use the new style introduced in de4d456. І've attached a
> small patch for this.

+1

> While looking around for other such error messages, I found a few dozen
> "must be superuser" errors that might be improved with the new style. If
> folks feel this is worthwhile, I'll put together a patch.

The new style is better for cases where we've broken out a predefined role
that has the necessary privilege. I'm not sure it's worth troubling
with cases that are still just "must be superuser". It seems like
you'd mostly just be creating work for the translation team.

regards, tom lane


From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: improve more permissions-related error messages
Date: 2023-05-12 20:46:18
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, May 12, 2023 at 04:43:08PM -0400, Tom Lane wrote:
> Nathan Bossart <nathandbossart(at)gmail(dot)com> writes:
>> While looking around for other such error messages, I found a few dozen
>> "must be superuser" errors that might be improved with the new style. If
>> folks feel this is worthwhile, I'll put together a patch.
>
> The new style is better for cases where we've broken out a predefined role
> that has the necessary privilege. I'm not sure it's worth troubling
> with cases that are still just "must be superuser". It seems like
> you'd mostly just be creating work for the translation team.

Makes sense, thanks.

--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com