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

Commitd8e6ae9

Browse files
committed
Fix tab-completion after commit790bf61
I (Álvaro) broke tab-completion for GRANT .. ALL TABLES IN SCHEMA whileremoving ALL from the publication syntax for schemas in theaforementioned commit. I also missed to update a bunch oftab-completion rules for ALTER/CREATE PUBLICATION that match eachindividual piece of ALL TABLES IN SCHEMA. Repair those bugs.While fixing up that commit, update a couple of outdated commentsrelated to the same change.Backpatch to 15.Author: Shi yu <shiy.fnst@fujitsu.com>Reviewed-by: Peter Smith <smithpb2250@gmail.com>Discussion:https://postgr.es/m/OSZPR01MB6310FCE8609185A56344EED2FD559@OSZPR01MB6310.jpnprd01.prod.outlook.com
1 parenta613474 commitd8e6ae9

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

‎src/backend/replication/logical/tablesync.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -937,8 +937,8 @@ fetch_remote_table_info(char *nspname, char *relname,
937937
*
938938
* 2) one of the subscribed publications has puballtables set to true
939939
*
940-
* 3) one of the subscribed publications is declared asALLTABLES IN
941-
*SCHEMAthat includes this relation
940+
* 3) one of the subscribed publications is declared as TABLES IN SCHEMA
941+
* that includes this relation
942942
*/
943943
if (walrcv_server_version(LogRepWorkerWalRcvConn) >=150000)
944944
{

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1848,7 +1848,7 @@ psql_completion(const char *text, int start, int end)
18481848
/* ALTER PUBLICATION <name> SET */
18491849
elseif (Matches("ALTER","PUBLICATION",MatchAny,"SET"))
18501850
COMPLETE_WITH("(","TABLES IN SCHEMA","TABLE");
1851-
elseif (Matches("ALTER","PUBLICATION",MatchAny,"ADD|DROP|SET","ALL","TABLES","IN","SCHEMA"))
1851+
elseif (Matches("ALTER","PUBLICATION",MatchAny,"ADD|DROP|SET","TABLES","IN","SCHEMA"))
18521852
COMPLETE_WITH_QUERY_PLUS(Query_for_list_of_schemas
18531853
" AND nspname NOT LIKE E'pg\\\\_%%'",
18541854
"CURRENT_SCHEMA");
@@ -2979,9 +2979,11 @@ psql_completion(const char *text, int start, int end)
29792979
elseif (Matches("CREATE","PUBLICATION",MatchAny,"FOR"))
29802980
COMPLETE_WITH("TABLE","ALL TABLES","TABLES IN SCHEMA");
29812981
elseif (Matches("CREATE","PUBLICATION",MatchAny,"FOR","ALL"))
2982-
COMPLETE_WITH("TABLES","TABLES IN SCHEMA");
2982+
COMPLETE_WITH("TABLES");
29832983
elseif (Matches("CREATE","PUBLICATION",MatchAny,"FOR","ALL","TABLES"))
2984-
COMPLETE_WITH("IN SCHEMA","WITH (");
2984+
COMPLETE_WITH("WITH (");
2985+
elseif (Matches("CREATE","PUBLICATION",MatchAny,"FOR","TABLES"))
2986+
COMPLETE_WITH("IN SCHEMA");
29852987
elseif (Matches("CREATE","PUBLICATION",MatchAny,"FOR","TABLE",MatchAny)&& !ends_with(prev_wd,','))
29862988
COMPLETE_WITH("WHERE (","WITH (");
29872989
/* Complete "CREATE PUBLICATION <name> FOR TABLE" with "<table>, ..." */
@@ -3002,11 +3004,11 @@ psql_completion(const char *text, int start, int end)
30023004
/*
30033005
* Complete "CREATE PUBLICATION <name> FOR TABLES IN SCHEMA <schema>, ..."
30043006
*/
3005-
elseif (Matches("CREATE","PUBLICATION",MatchAny,"FOR","ALL","TABLES","IN","SCHEMA"))
3007+
elseif (Matches("CREATE","PUBLICATION",MatchAny,"FOR","TABLES","IN","SCHEMA"))
30063008
COMPLETE_WITH_QUERY_PLUS(Query_for_list_of_schemas
30073009
" AND nspname NOT LIKE E'pg\\\\_%%'",
30083010
"CURRENT_SCHEMA");
3009-
elseif (Matches("CREATE","PUBLICATION",MatchAny,"FOR","ALL","TABLES","IN","SCHEMA",MatchAny)&& (!ends_with(prev_wd,',')))
3011+
elseif (Matches("CREATE","PUBLICATION",MatchAny,"FOR","TABLES","IN","SCHEMA",MatchAny)&& (!ends_with(prev_wd,',')))
30103012
COMPLETE_WITH("WITH (");
30113013
/* Complete "CREATE PUBLICATION <name> [...] WITH" */
30123014
elseif (HeadMatches("CREATE","PUBLICATION")&&TailMatches("WITH","("))
@@ -3820,7 +3822,7 @@ psql_completion(const char *text, int start, int end)
38203822
"ALL PROCEDURES IN SCHEMA",
38213823
"ALL ROUTINES IN SCHEMA",
38223824
"ALL SEQUENCES IN SCHEMA",
3823-
"TABLES IN SCHEMA",
3825+
"ALLTABLES IN SCHEMA",
38243826
"DATABASE",
38253827
"DOMAIN",
38263828
"FOREIGN DATA WRAPPER",

‎src/test/subscription/t/031_column_list.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -899,8 +899,8 @@
899899
'all columns should be replicated');
900900

901901

902-
# TEST: With a table included in the publication which is FORALLTABLES
903-
#INSCHEMA, it means replicate all columns.
902+
# TEST: With a table included in the publication which is FOR TABLES IN
903+
# SCHEMA, it means replicate all columns.
904904

905905
$node_subscriber->safe_psql(
906906
'postgres',qq(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp