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

Commit752a4da

Browse files
committed
psql: tab completion for \encoding
Ian Barwick
1 parent9243664 commit752a4da

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000-2002 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.79 2003/06/11 22:13:22 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.80 2003/06/12 01:38:08 momjian Exp $
77
*/
88

99
/*----------------------------------------------------------------------
@@ -207,6 +207,11 @@ initialize_readline(void)
207207
" WHERE substr(nspname,1,%d)='%s' "\
208208
" HAVING COUNT(nspname)=1))"
209209

210+
#defineQuery_for_list_of_encodings \
211+
" SELECT DISTINCT pg_catalog.pg_encoding_to_char(conforencoding) "\
212+
" FROM pg_catalog.pg_conversion "\
213+
" WHERE substr(pg_catalog.pg_encoding_to_char(conforencoding),1,%d)=UPPER('%s')"
214+
210215
#defineQuery_for_list_of_functions \
211216
" SELECT DISTINCT proname || '()' "\
212217
" FROM pg_catalog.pg_proc p, pg_catalog.pg_namespace n "\
@@ -1273,6 +1278,8 @@ psql_completion(char *text, int start, int end)
12731278
COMPLETE_WITH_QUERY(Query_for_list_of_users);
12741279
elseif (strcmp(prev_wd,"\\dv")==0||strcmp(prev_wd,"\\dv+")==0)
12751280
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_views);
1281+
elseif (strcmp(prev_wd,"\\encoding")==0)
1282+
COMPLETE_WITH_QUERY(Query_for_list_of_encodings);
12761283
elseif (strcmp(prev_wd,"\\h")==0||strcmp(prev_wd,"\\help")==0)
12771284
COMPLETE_WITH_LIST(sql_commands);
12781285
elseif (strcmp(prev_wd,"\\pset")==0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp