Re: Extend ALTER DEFAULT PRIVILEGES for large objects

Поиск
Список
Период
Сортировка
От Fujii Masao
Тема Re: Extend ALTER DEFAULT PRIVILEGES for large objects
Дата
Msg-id b448cc01-ce8d-45f3-a922-c63490bbdec4@oss.nttdata.com
обсуждение исходный текст
Ответ на Re: Extend ALTER DEFAULT PRIVILEGES for large objects  (Yugo Nagata <nagata@sraoss.co.jp>)
Ответы Re: Extend ALTER DEFAULT PRIVILEGES for large objects
Список pgsql-hackers

On 2025/06/11 11:49, Yugo Nagata wrote:
> While looking at the thread [1], I've remembered this thread.
> The patches in this thread are partially v18-related, but include
> enhancement or fixes for existing feature, so should they be postponed
> to v19, or should be separated properly to v18 part and other?
> 
> [1] https://www.postgresql.org/message-id/70372bdd-4399-4d5b-ab4f-6d4487a4911a%40oss.nttdata.com

I see these patches more as enhancements to psql tab-completion,
rather than fixes for clear oversights in the original commit.

For example, if tab-completion for ALTER DEFAULT PRIVILEGES had
completely missed LARGE OBJECTS, that would be an obvious oversight.
But these patches go beyond that kind of issue.

That said, if others think it's appropriate to include them in v18
for consistency or completeness, I'm fine with that.

Regarding the 0002 patch:

-    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))
+    {
+        if (TailMatches("FOREIGN", "SERVER"))
+            COMPLETE_WITH_QUERY(Query_for_list_of_servers);
+        else if (!TailMatches("LARGE", "OBJECT"))
+        {
+            if (Matches("GRANT", MatchAnyN, "ON", MatchAny, MatchAny))
+                COMPLETE_WITH("TO");
+            else
+                COMPLETE_WITH("FROM");
+        }
+    }

Wouldn't this change break the case where "GRANT ... ON TABLE ... <TAB>"
is supposed to complete with "TO"?

Regards,

-- 
Fujii Masao
NTT DATA Japan Corporation




В списке pgsql-hackers по дате отправления: