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

Commitdcf5d7f

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 parentb994acf commitdcf5d7f

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
@@ -1426,6 +1426,10 @@ psql_completion(const char *text, int start, int end)
14261426
COMPLETE_WITH_LIST(list_ALTERMATVIEW);
14271427
}
14281428

1429+
/* ALTER POLICY <name> */
1430+
elseif (pg_strcasecmp(prev2_wd,"ALTER")==0&&
1431+
pg_strcasecmp(prev_wd,"POLICY")==0)
1432+
COMPLETE_WITH_QUERY(Query_for_list_of_policies);
14291433
/* ALTER POLICY <name> ON */
14301434
elseif (pg_strcasecmp(prev3_wd,"ALTER")==0&&
14311435
pg_strcasecmp(prev2_wd,"POLICY")==0)
@@ -1434,7 +1438,10 @@ psql_completion(const char *text, int start, int end)
14341438
elseif (pg_strcasecmp(prev4_wd,"ALTER")==0&&
14351439
pg_strcasecmp(prev3_wd,"POLICY")==0&&
14361440
pg_strcasecmp(prev_wd,"ON")==0)
1437-
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables,NULL);
1441+
{
1442+
completion_info_charp=prev2_wd;
1443+
COMPLETE_WITH_QUERY(Query_for_list_of_tables_for_policy);
1444+
}
14381445
/* ALTER POLICY <name> ON <table> - show options */
14391446
elseif (pg_strcasecmp(prev5_wd,"ALTER")==0&&
14401447
pg_strcasecmp(prev4_wd,"POLICY")==0&&

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp