Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8b469bd

Browse files
committed
Improve ALTER POLICY tab completion.
Complete "ALTER POLICY" with a policy name, as we do for DROP POLICY.And, complete "ALTER POLICY polname ON" with a table name that has sucha policy, as we do for DROP POLICY, rather than with any table nameat all.Masahiko Sawada
1 parent348bcd8 commit8b469bd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1459,6 +1459,10 @@ psql_completion(const char *text, int start, int end)
14591459
COMPLETE_WITH_LIST(list_ALTERMATVIEW);
14601460
}
14611461

1462+
/* ALTER POLICY <name> */
1463+
elseif (pg_strcasecmp(prev2_wd,"ALTER")==0&&
1464+
pg_strcasecmp(prev_wd,"POLICY")==0)
1465+
COMPLETE_WITH_QUERY(Query_for_list_of_policies);
14621466
/* ALTER POLICY <name> ON */
14631467
elseif (pg_strcasecmp(prev3_wd,"ALTER")==0&&
14641468
pg_strcasecmp(prev2_wd,"POLICY")==0)
@@ -1467,7 +1471,10 @@ psql_completion(const char *text, int start, int end)
14671471
elseif (pg_strcasecmp(prev4_wd,"ALTER")==0&&
14681472
pg_strcasecmp(prev3_wd,"POLICY")==0&&
14691473
pg_strcasecmp(prev_wd,"ON")==0)
1470-
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables,NULL);
1474+
{
1475+
completion_info_charp=prev2_wd;
1476+
COMPLETE_WITH_QUERY(Query_for_list_of_tables_for_policy);
1477+
}
14711478
/* ALTER POLICY <name> ON <table> - show options */
14721479
elseif (pg_strcasecmp(prev5_wd,"ALTER")==0&&
14731480
pg_strcasecmp(prev4_wd,"POLICY")==0&&

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp