diff options
author | Bruce Momjian <bruce@momjian.us> | 2005-05-25 22:12:05 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2005-05-25 22:12:05 +0000 |
commit | bbb586ff211c2d304db4a64e8c3ea715a4ecebb5 (patch) | |
tree | 2871acb7a4cc52d1548fd95de93a2396a41effa6 | |
parent | b492c3acccb3f8c97559ddfc2a25f25953a026d2 (diff) | |
download | postgresql-bbb586ff211c2d304db4a64e8c3ea715a4ecebb5.tar.gz postgresql-bbb586ff211c2d304db4a64e8c3ea715a4ecebb5.zip |
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
-rw-r--r-- | src/bin/psql/tab-complete.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 571d7b34cfd..3d1ce4ca122 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2005, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.129 2005/05/18 05:01:10 neilc Exp $ + * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.130 2005/05/25 22:12:05 momjian Exp $ */ /*---------------------------------------------------------------------- @@ -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 <sth> DROP, provide COLUMN or CONSTRAINT */ |