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

Commitda9ee02

Browse files
committed
psql: Add some tab completion for TABLESAMPLE.
Petr Jelinek, reviewed by Brendan Jurd
1 parent4318118 commitda9ee02

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,11 @@ static const SchemaQuery Query_for_list_of_matviews = {
737737
" FROM pg_catalog.pg_event_trigger "\
738738
" WHERE substring(pg_catalog.quote_ident(evtname),1,%d)='%s'"
739739

740+
#defineQuery_for_list_of_tablesample_methods \
741+
" SELECT pg_catalog.quote_ident(tsmname) "\
742+
" FROM pg_catalog.pg_tablesample_method "\
743+
" WHERE substring(pg_catalog.quote_ident(tsmname),1,%d)='%s'"
744+
740745
/*
741746
* This is a list of all "things" in Pgsql, which can show up after CREATE or
742747
* DROP; and there is also a query to get a list of them.
@@ -3580,6 +3585,13 @@ psql_completion(const char *text, int start, int end)
35803585
prev2_wd[0]=='\0')
35813586
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_relations,NULL);
35823587

3588+
/* TABLESAMPLE */
3589+
elseif (pg_strcasecmp(prev_wd,"TABLESAMPLE")==0)
3590+
COMPLETE_WITH_QUERY(Query_for_list_of_tablesample_methods);
3591+
3592+
elseif (pg_strcasecmp(prev2_wd,"TABLESAMPLE")==0)
3593+
COMPLETE_WITH_CONST("(");
3594+
35833595
/* TRUNCATE */
35843596
elseif (pg_strcasecmp(prev_wd,"TRUNCATE")==0)
35853597
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables,NULL);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp