Commit 0b46e82c authored by Michael Paquier's avatar Michael Paquier

Add tab completion for ALTER TABLE .. FORCE ROW LEVEL SECURITY in psql

This completes both the FORCE and NO FORCE options, NO INHERIT needing a
small adjustment.

Author: Li Japin
Discussion: https://postgr.es/m/15B10F9F-5847-4F5E-BD66-8E25AA473C95@hotmail.com
parent 321633e1
......@@ -1974,10 +1974,10 @@ psql_completion(const char *text, int start, int end)
*/
else if (Matches("ALTER", "TABLE", MatchAny))
COMPLETE_WITH("ADD", "ALTER", "CLUSTER ON", "DISABLE", "DROP",
"ENABLE", "INHERIT", "NO INHERIT", "RENAME", "RESET",
"ENABLE", "INHERIT", "NO", "RENAME", "RESET",
"OWNER TO", "SET", "VALIDATE CONSTRAINT",
"REPLICA IDENTITY", "ATTACH PARTITION",
"DETACH PARTITION");
"DETACH PARTITION", "FORCE ROW LEVEL SECURITY");
/* ALTER TABLE xxx ENABLE */
else if (Matches("ALTER", "TABLE", MatchAny, "ENABLE"))
COMPLETE_WITH("ALWAYS", "REPLICA", "ROW LEVEL SECURITY", "RULE",
......@@ -2007,6 +2007,9 @@ psql_completion(const char *text, int start, int end)
/* ALTER TABLE xxx INHERIT */
else if (Matches("ALTER", "TABLE", MatchAny, "INHERIT"))
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, "");
/* ALTER TABLE xxx NO */
else if (Matches("ALTER", "TABLE", MatchAny, "NO"))
COMPLETE_WITH("FORCE ROW LEVEL SECURITY", "INHERIT");
/* ALTER TABLE xxx NO INHERIT */
else if (Matches("ALTER", "TABLE", MatchAny, "NO", "INHERIT"))
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, "");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment