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

Commit bbb586f

Browse files
committed
Quick patch to adress a recent concern on the mailing list
about adding an errant "TO" when we already have a TO. Since TO cannot be a valid column name (we must quote it), we can simply ignore the tab-completion if the previous word was a "TO". Greg Sabino Mullane
1 parent b492c3a commit bbb586f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/bin/psql/tab-complete.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.129 2005/05/18 05:01:10 neilc Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.130 2005/05/25 22:12:05 momjian Exp $
77
*/
88

99
/*----------------------------------------------------------------------
@@ -827,7 +827,8 @@ psql_completion(char *text, int start, int end)
827827

828828
/* ALTER TABLE xxx RENAME yyy */
829829
else if (pg_strcasecmp(prev4_wd, "TABLE") == 0 &&
830-
pg_strcasecmp(prev2_wd, "RENAME") == 0)
830+
pg_strcasecmp(prev2_wd, "RENAME") == 0 &&
831+
pg_strcasecmp(prev_wd, "TO") != 0)
831832
COMPLETE_WITH_CONST("TO");
832833

833834
/* If we have TABLE <sth> DROP, provide COLUMN or CONSTRAINT */

0 commit comments

Comments
 (0)