From 16efdb5ec7f28bed9541fc773330e3e2ebe2ed9a Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Thu, 26 Apr 2007 16:13:15 +0000 Subject: Rename the newly-added commands for discarding session state. RESET SESSION, RESET PLANS, and RESET TEMP are now DISCARD ALL, DISCARD PLANS, and DISCARD TEMP, respectively. This is to avoid confusion with the pre-existing RESET variants: the DISCARD commands are not actually similar to RESET. Patch from Marko Kreen, with some minor editorialization. --- src/bin/psql/tab-complete.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/bin') diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 090030fd0c..2ec534cba4 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2007, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.161 2007/04/08 00:26:34 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.162 2007/04/26 16:13:13 neilc Exp $ */ /*---------------------------------------------------------------------- @@ -527,8 +527,8 @@ psql_completion(char *text, int start, int end) static const char *const sql_commands[] = { "ABORT", "ALTER", "ANALYZE", "BEGIN", "CHECKPOINT", "CLOSE", "CLUSTER", "COMMENT", "COMMIT", "COPY", "CREATE", "DEALLOCATE", "DECLARE", - "DELETE FROM", "DROP", "END", "EXECUTE", "EXPLAIN", "FETCH", "GRANT", - "INSERT", "LISTEN", "LOAD", "LOCK", "MOVE", "NOTIFY", "PREPARE", + "DELETE FROM", "DISCARD", "DROP", "END", "EXECUTE", "EXPLAIN", "FETCH", + "GRANT", "INSERT", "LISTEN", "LOAD", "LOCK", "MOVE", "NOTIFY", "PREPARE", "REASSIGN", "REINDEX", "RELEASE", "RESET", "REVOKE", "ROLLBACK", "SAVEPOINT", "SELECT", "SET", "SHOW", "START", "TRUNCATE", "UNLISTEN", "UPDATE", "VACUUM", NULL @@ -1244,6 +1244,15 @@ psql_completion(char *text, int start, int end) } /* XXX: implement tab completion for DELETE ... USING */ +/* DISCARD */ + else if (pg_strcasecmp(prev_wd, "DISCARD") == 0) + { + static const char *const list_DISCARD[] = + {"ALL", "PLANS", "TEMP", NULL}; + + COMPLETE_WITH_LIST(list_DISCARD); + } + /* DROP (when not the previous word) */ /* DROP AGGREGATE */ else if (pg_strcasecmp(prev3_wd, "DROP") == 0 && -- cgit v1.2.1