public inbox for [email protected]
help / color / mirror / Atom feedFrom: Yugo Nagata <[email protected]>
To: Fujii Masao <[email protected]>
Cc: Laurenz Albe <[email protected]>
Cc: Nathan Bossart <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: [email protected]
Subject: Re: Extend ALTER DEFAULT PRIVILEGES for large objects
Date: Thu, 10 Jul 2025 14:11:29 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<20240424210839.GA863220@nathanxps13>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
On Thu, 10 Jul 2025 13:23:47 +0900
Fujii Masao <[email protected]> wrote:
>
>
> On 2025/07/10 10:30, Yugo Nagata wrote:
> > You're right. I must have overlooked something. I think I saw "TO" being
> > suggested after "FOREIGN SERVER" when no foreign servers were defined.
> >
> > The attached patch still prevents "TO/FROM" from being suggested after
> > "FOREIGN SERVER" in such cases.
>
> Based on your patch, I'm thinking of simplifying the code like this:
>
> - else if (Matches("GRANT", MatchAnyN, "ON", MatchAny, MatchAny))
> - COMPLETE_WITH("TO");
> - else if (Matches("REVOKE", MatchAnyN, "ON", MatchAny, MatchAny))
> - COMPLETE_WITH("FROM");
> + else if (Matches("GRANT|REVOKE", MatchAnyN, "ON", MatchAny, MatchAny) &&
> + !TailMatches("FOREIGN", "SERVER") && !TailMatches("LARGE", "OBJECT"))
> + {
> + if (Matches("GRANT", MatchAnyN, "ON", MatchAny, MatchAny))
> + COMPLETE_WITH("TO");
> + else
> + COMPLETE_WITH("FROM");
> + }
Thank you for your review!
I agree with your suggestion and have updated the patch accordingly.
>
> > But perhaps this corner case doesn't really
> > need to be handled?
>
> Probably I failed to get your point here. Could you clarify what you meant?
I'm sorry for not explaining it clearly.
Currently, TO or FROM could be suggested immediately after FOREIGN SERVER, but
only when no foreign servers are defined. When foreign servers do exist,
their names are correctly suggested instead, as expected.
The patch fixed the behavior so that TO or FROM are not suggested after FOREIGN SERVER,
even when no foreign servers are defined. However, I've started to wonder if it's worth
fixing such a corner case. What do you think?
Regards,
Yugo Nagata
--
Yugo Nagata <[email protected]>
view thread (33+ messages) latest in thread
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: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: Extend ALTER DEFAULT PRIVILEGES for large objects
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox