Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 11193c8

Browse files
committed
For INSERTs, one can now tab complete DEFAULT VALUES.
from Liam Stewart
1 parent 7ecff3f commit 11193c8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/bin/psql/tab-complete.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.35 2001/08/01 18:45:50 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.36 2001/08/30 13:17:03 petere Exp $
77
*/
88

99
/*----------------------------------------------------------------------
@@ -576,15 +576,15 @@ psql_completion(char *text, int start, int end)
576576
/* Complete INSERT INTO with table names */
577577
else if (strcasecmp(prev2_wd, "INSERT") == 0 && strcasecmp(prev_wd, "INTO") == 0)
578578
COMPLETE_WITH_QUERY(Query_for_list_of_tables);
579-
/* Complete INSERT INTO <table> with "VALUES" or "SELECT" */
579+
/* Complete INSERT INTO <table> with "VALUES" or "SELECT" or "DEFAULT VALUES" */
580580
else if (strcasecmp(prev3_wd, "INSERT") == 0 && strcasecmp(prev2_wd, "INTO") == 0)
581581
{
582-
char *list_INSERT[] = {"SELECT", "VALUES", NULL};
582+
char *list_INSERT[] = {"DEFAULT VALUES", "SELECT", "VALUES", NULL};
583583

584584
COMPLETE_WITH_LIST(list_INSERT);
585585
}
586586
/* Insert an open parenthesis after "VALUES" */
587-
else if (strcasecmp(prev_wd, "VALUES") == 0)
587+
else if (strcasecmp(prev_wd, "VALUES") == 0 && strcasecmp(prev2_wd, "DEFAULT") != 0)
588588
COMPLETE_WITH_CONST("(");
589589

590590
/* LOCK */

0 commit comments

Comments
 (0)