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)
927927pg_strcasecmp (prev_wd ,"USER" )== 0 )
928928COMPLETE_WITH_QUERY (Query_for_list_of_users );
929929
930- /* BEGIN, END,COMMIT, ABORT */
930+ /* BEGIN, END, ABORT */
931931else if (pg_strcasecmp (prev_wd ,"BEGIN" )== 0 ||
932932pg_strcasecmp (prev_wd ,"END" )== 0 ||
933- pg_strcasecmp (prev_wd ,"COMMIT" )== 0 ||
934933pg_strcasecmp (prev_wd ,"ABORT" )== 0 )
935934{
936935static const char * const list_TRANS []=
937936{"WORK" ,"TRANSACTION" ,NULL };
938937
939938COMPLETE_WITH_LIST (list_TRANS );
939+ }
940+ /* COMMIT */
941+ else if (pg_strcasecmp (prev_wd ,"COMMIT" )== 0 )
942+ {
943+ static const char * const list_COMMIT []=
944+ {"WORK" ,"TRANSACTION" ,"PREPARED" ,NULL };
945+
946+ COMPLETE_WITH_LIST (list_COMMIT );
940947}
941948/* RELEASE SAVEPOINT */
942949else if (pg_strcasecmp (prev_wd ,"RELEASE" )== 0 )
@@ -945,7 +952,7 @@ psql_completion(char *text, int start, int end)
945952else if (pg_strcasecmp (prev_wd ,"ROLLBACK" )== 0 )
946953{
947954static const char * const list_TRANS []=
948- {"WORK" ,"TRANSACTION" ,"TO SAVEPOINT" ,NULL };
955+ {"WORK" ,"TRANSACTION" ,"TO SAVEPOINT" ,"PREPARED" , NULL };
949956
950957COMPLETE_WITH_LIST (list_TRANS );
951958}