From: Bruce Momjian Date: Wed, 25 May 2005 22:12:05 +0000 (+0000) Subject: Quick patch to adress a recent concern on the mailing list X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=004403113bd1501d0b27efd1c84b69fddc61e793;p=users%2Fbernd%2Fpostgres.git 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 --- diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 86eb70b61e..16a48ddad4 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -827,7 +827,8 @@ psql_completion(char *text, int start, int end) /* ALTER TABLE xxx RENAME yyy */ else if (pg_strcasecmp(prev4_wd, "TABLE") == 0 && - pg_strcasecmp(prev2_wd, "RENAME") == 0) + pg_strcasecmp(prev2_wd, "RENAME") == 0 && + pg_strcasecmp(prev_wd, "TO") != 0) COMPLETE_WITH_CONST("TO"); /* If we have TABLE DROP, provide COLUMN or CONSTRAINT */