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

Commitef85f5f

Browse files
committed
Add tab completion syntax for PREPARE 2-phase commit syntax.
There's no tab-completion for "PREPARE TRANSACTION 'xxx'" since thatwould be ambigous with "PREPARE xxx AS xx".Heikki Linnakangas
1 parenta4ca842 commitef85f5f

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.134 2005/07/23 21:05:47 tgl Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.135 2005/07/28 22:14:30 momjian Exp $
77
*/
88

99
/*----------------------------------------------------------------------
@@ -927,16 +927,23 @@ psql_completion(char *text, int start, int end)
927927
pg_strcasecmp(prev_wd,"USER")==0)
928928
COMPLETE_WITH_QUERY(Query_for_list_of_users);
929929

930-
/* BEGIN, END,COMMIT,ABORT */
930+
/* BEGIN, END, ABORT */
931931
elseif (pg_strcasecmp(prev_wd,"BEGIN")==0||
932932
pg_strcasecmp(prev_wd,"END")==0||
933-
pg_strcasecmp(prev_wd,"COMMIT")==0||
934933
pg_strcasecmp(prev_wd,"ABORT")==0)
935934
{
936935
staticconstchar*constlist_TRANS[]=
937936
{"WORK","TRANSACTION",NULL};
938937

939938
COMPLETE_WITH_LIST(list_TRANS);
939+
}
940+
/* COMMIT */
941+
elseif(pg_strcasecmp(prev_wd,"COMMIT")==0)
942+
{
943+
staticconstchar*constlist_COMMIT[]=
944+
{"WORK","TRANSACTION","PREPARED",NULL};
945+
946+
COMPLETE_WITH_LIST(list_COMMIT);
940947
}
941948
/* RELEASE SAVEPOINT */
942949
elseif (pg_strcasecmp(prev_wd,"RELEASE")==0)
@@ -945,7 +952,7 @@ psql_completion(char *text, int start, int end)
945952
elseif (pg_strcasecmp(prev_wd,"ROLLBACK")==0)
946953
{
947954
staticconstchar*constlist_TRANS[]=
948-
{"WORK","TRANSACTION","TO SAVEPOINT",NULL};
955+
{"WORK","TRANSACTION","TO SAVEPOINT","PREPARED",NULL};
949956

950957
COMPLETE_WITH_LIST(list_TRANS);
951958
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp