diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2010-08-14 13:59:49 +0000 | 
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2010-08-14 13:59:49 +0000 | 
| commit | b6e06942c6b880b79097049757a8d140cd4316c0 (patch) | |
| tree | 83a9a7989612cae943d87e171dca28b730950635 /src/bin/psql/tab-complete.c | |
| parent | 946b07804478d379d29b2b2038a5729b3cad2f55 (diff) | |
Add a \sf (show function) command to psql, for those times when you need to
look at a function but don't wish to fire up an editor.
Pavel Stehule, reviewed by Jan Urbanski
Diffstat (limited to 'src/bin/psql/tab-complete.c')
| -rw-r--r-- | src/bin/psql/tab-complete.c | 6 | 
1 files changed, 4 insertions, 2 deletions
| diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 5368d4ac45c..0c2d5bc7809 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -3,7 +3,7 @@   *   * Copyright (c) 2000-2010, PostgreSQL Global Development Group   * - * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.201 2010/07/20 03:54:19 rhaas Exp $ + * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.202 2010/08/14 13:59:49 tgl Exp $   */  /*---------------------------------------------------------------------- @@ -644,7 +644,7 @@ psql_completion(char *text, int start, int end)  		"\\f", "\\g", "\\h", "\\help", "\\H", "\\i", "\\l",  		"\\lo_import", "\\lo_export", "\\lo_list", "\\lo_unlink",  		"\\o", "\\p", "\\password", "\\prompt", "\\pset", "\\q", "\\qecho", "\\r", -		"\\set", "\\t", "\\T", +		"\\set", "\\sf", "\\t", "\\T",  		"\\timing", "\\unset", "\\x", "\\w", "\\z", "\\!", NULL  	}; @@ -2517,6 +2517,8 @@ psql_completion(char *text, int start, int end)  		COMPLETE_WITH_LIST(my_list);  	} +	else if (strcmp(prev_wd, "\\sf") == 0 || strcmp(prev_wd, "\\sf+") == 0) +		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_functions, NULL);  	else if (strcmp(prev_wd, "\\cd") == 0 ||  			 strcmp(prev_wd, "\\e") == 0 || strcmp(prev_wd, "\\edit") == 0 ||  			 strcmp(prev_wd, "\\g") == 0 || | 
