diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-07-27 05:11:48 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-07-27 05:11:48 +0000 |
| commit | cc813fc2b8d9293bbd4d0e0d6a6f3b9cf02fe32f (patch) | |
| tree | 9f7e6635c94bb61cb9d6340c3647c429dca9504b /src/bin/psql/tab-complete.c | |
| parent | b1ee93884d528672fbce446a38659954a86219e1 (diff) | |
Replace nested-BEGIN syntax for subtransactions with spec-compliant
SAVEPOINT/RELEASE/ROLLBACK-TO syntax. (Alvaro)
Cause COMMIT of a failed transaction to report ROLLBACK instead of
COMMIT in its command tag. (Tom)
Fix a few loose ends in the nested-transactions stuff.
Diffstat (limited to 'src/bin/psql/tab-complete.c')
| -rw-r--r-- | src/bin/psql/tab-complete.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index f26c3e75337..0dfaebe38b0 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2003, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.107 2004/05/26 13:56:55 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.108 2004/07/27 05:11:11 tgl Exp $ */ /*---------------------------------------------------------------------- @@ -463,8 +463,8 @@ psql_completion(char *text, int start, int end) "ABORT", "ALTER", "ANALYZE", "BEGIN", "CHECKPOINT", "CLOSE", "CLUSTER", "COMMENT", "COMMIT", "COPY", "CREATE", "DEALLOCATE", "DECLARE", "DELETE", "DROP", "EXECUTE", "EXPLAIN", "FETCH", "GRANT", "INSERT", "LISTEN", "LOAD", "LOCK", "MOVE", "NOTIFY", - "PREPARE", "REINDEX", "RESET", "REVOKE", "ROLLBACK", "SELECT", "SET", "SHOW", "START", - "TRUNCATE", "UNLISTEN", "UPDATE", "VACUUM", NULL + "PREPARE", "REINDEX", "RELEASE", "RESET", "REVOKE", "ROLLBACK", "SAVEPOINT", + "SELECT", "SET", "SHOW", "START", "TRUNCATE", "UNLISTEN", "UPDATE", "VACUUM", NULL }; static const char * const pgsql_variables[] = { @@ -722,11 +722,10 @@ psql_completion(char *text, int start, int end) else if (pg_strcasecmp(prev2_wd, "ANALYZE") == 0) COMPLETE_WITH_CONST(";"); -/* BEGIN, COMMIT, ROLLBACK, ABORT, */ +/* BEGIN, COMMIT, ABORT */ else if (pg_strcasecmp(prev_wd, "BEGIN") == 0 || pg_strcasecmp(prev_wd, "END") == 0 || pg_strcasecmp(prev_wd, "COMMIT") == 0 || - pg_strcasecmp(prev_wd, "ROLLBACK") == 0 || pg_strcasecmp(prev_wd, "ABORT") == 0) { static const char * const list_TRANS[] = @@ -734,6 +733,14 @@ psql_completion(char *text, int start, int end) COMPLETE_WITH_LIST(list_TRANS); } +/* ROLLBACK*/ + else if ( pg_strcasecmp(prev_wd, "ROLLBACK") == 0 ) + { + static const char * const list_TRANS[] = + {"WORK", "TRANSACTION", "TO", NULL}; + + COMPLETE_WITH_LIST(list_TRANS); + } /* CLUSTER */ /* If the previous word is CLUSTER, produce list of indexes. */ else if (pg_strcasecmp(prev_wd, "CLUSTER") == 0) |
