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

Commit69298db

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 parent51fd7cd commit69298db

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
@@ -978,8 +978,8 @@ fetch_remote_table_info(char *nspname, char *relname,
978978
*
979979
* 2) one of the subscribed publications has puballtables set to true
980980
*
981-
* 3) one of the subscribed publications is declared asALLTABLES IN
982-
*SCHEMAthat includes this relation
981+
* 3) one of the subscribed publications is declared as TABLES IN SCHEMA
982+
* that includes this relation
983983
*/
984984
if (walrcv_server_version(LogRepWorkerWalRcvConn) >=150000)
985985
{

‎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");
@@ -2994,9 +2994,11 @@ psql_completion(const char *text, int start, int end)
29942994
elseif (Matches("CREATE","PUBLICATION",MatchAny,"FOR"))
29952995
COMPLETE_WITH("TABLE","ALL TABLES","TABLES IN SCHEMA");
29962996
elseif (Matches("CREATE","PUBLICATION",MatchAny,"FOR","ALL"))
2997-
COMPLETE_WITH("TABLES","TABLES IN SCHEMA");
2997+
COMPLETE_WITH("TABLES");
29982998
elseif (Matches("CREATE","PUBLICATION",MatchAny,"FOR","ALL","TABLES"))
2999-
COMPLETE_WITH("IN SCHEMA","WITH (");
2999+
COMPLETE_WITH("WITH (");
3000+
elseif (Matches("CREATE","PUBLICATION",MatchAny,"FOR","TABLES"))
3001+
COMPLETE_WITH("IN SCHEMA");
30003002
elseif (Matches("CREATE","PUBLICATION",MatchAny,"FOR","TABLE",MatchAny)&& !ends_with(prev_wd,','))
30013003
COMPLETE_WITH("WHERE (","WITH (");
30023004
/* Complete "CREATE PUBLICATION <name> FOR TABLE" with "<table>, ..." */
@@ -3017,11 +3019,11 @@ psql_completion(const char *text, int start, int end)
30173019
/*
30183020
* Complete "CREATE PUBLICATION <name> FOR TABLES IN SCHEMA <schema>, ..."
30193021
*/
3020-
elseif (Matches("CREATE","PUBLICATION",MatchAny,"FOR","ALL","TABLES","IN","SCHEMA"))
3022+
elseif (Matches("CREATE","PUBLICATION",MatchAny,"FOR","TABLES","IN","SCHEMA"))
30213023
COMPLETE_WITH_QUERY_PLUS(Query_for_list_of_schemas
30223024
" AND nspname NOT LIKE E'pg\\\\_%%'",
30233025
"CURRENT_SCHEMA");
3024-
elseif (Matches("CREATE","PUBLICATION",MatchAny,"FOR","ALL","TABLES","IN","SCHEMA",MatchAny)&& (!ends_with(prev_wd,',')))
3026+
elseif (Matches("CREATE","PUBLICATION",MatchAny,"FOR","TABLES","IN","SCHEMA",MatchAny)&& (!ends_with(prev_wd,',')))
30253027
COMPLETE_WITH("WITH (");
30263028
/* Complete "CREATE PUBLICATION <name> [...] WITH" */
30273029
elseif (HeadMatches("CREATE","PUBLICATION")&&TailMatches("WITH","("))
@@ -3835,7 +3837,7 @@ psql_completion(const char *text, int start, int end)
38353837
"ALL PROCEDURES IN SCHEMA",
38363838
"ALL ROUTINES IN SCHEMA",
38373839
"ALL SEQUENCES IN SCHEMA",
3838-
"TABLES IN SCHEMA",
3840+
"ALLTABLES IN SCHEMA",
38393841
"DATABASE",
38403842
"DOMAIN",
38413843
"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