Skip to content

Commit 3d11c78

Browse files
author
Commitfest Bot
committed
[CF 4945] v1 - Extend ALTER DEFAULT PRIVILEGES for large objects
This branch was automatically generated by a robot using patches from an email thread registered at: https://commitfest.postgresql.org/patch/4945 The branch will be overwritten each time a new patch version is posted to the thread, and also periodically to check for bitrot caused by changes on the master branch. Patch(es): https://www.postgresql.org/message-id/[email protected] Author(s): Yugo Nagata
2 parents 534874f + aec9987 commit 3d11c78

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/bin/psql/tab-complete.in.c

+20
Original file line numberDiff line numberDiff line change
@@ -4602,6 +4602,26 @@ match_previous_words(int pattern_id,
46024602
COMPLETE_WITH("FROM");
46034603
}
46044604

4605+
/* Complete "GRANT/REVOKE * ON LARGE OBJECT *" with TO/FROM */
4606+
else if (TailMatches("GRANT|REVOKE", MatchAny, "ON", "LARGE", "OBJECT", MatchAny) ||
4607+
TailMatches("REVOKE", "GRANT", "OPTION", "FOR", MatchAny, "ON", "LARGE", "OBJECT", MatchAny))
4608+
{
4609+
if (TailMatches("GRANT", MatchAny, MatchAny, MatchAny, MatchAny, MatchAny))
4610+
COMPLETE_WITH("TO");
4611+
else
4612+
COMPLETE_WITH("FROM");
4613+
}
4614+
4615+
/* Complete "GRANT/REVOKE * ON LARGE OBJECTS" with TO/FROM */
4616+
else if (TailMatches("GRANT|REVOKE", MatchAny, "ON", "LARGE", "OBJECTS") ||
4617+
TailMatches("REVOKE", "GRANT", "OPTION", "FOR", MatchAny, "ON", "LARGE", "OBJECTS"))
4618+
{
4619+
if (TailMatches("GRANT", MatchAny, MatchAny, MatchAny, MatchAny))
4620+
COMPLETE_WITH("TO");
4621+
else
4622+
COMPLETE_WITH("FROM");
4623+
}
4624+
46054625
/* GROUP BY */
46064626
else if (TailMatches("FROM", MatchAny, "GROUP"))
46074627
COMPLETE_WITH("BY");

0 commit comments

Comments
 (0)