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

Commit202cbdf

Browse files
committed
Add tab-completion for ALTER TABLE ALTER CONSTRAINT in psql.
Back-patch to 9.4 where ALTER TABLE ALTER CONSTRAINT was added.Michael Paquier, bug reported by Andrey Lizenko.
1 parentafeacd2 commit202cbdf

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,7 @@ psql_completion(const char *text, int start, int end)
16051605
elseif (pg_strcasecmp(prev4_wd,"ALTER")==0&&
16061606
pg_strcasecmp(prev3_wd,"TABLE")==0&&
16071607
pg_strcasecmp(prev_wd,"ALTER")==0)
1608-
COMPLETE_WITH_ATTR(prev2_wd," UNION SELECT 'COLUMN'");
1608+
COMPLETE_WITH_ATTR(prev2_wd," UNION SELECT 'COLUMN' UNION SELECT 'CONSTRAINT'");
16091609

16101610
/* ALTER TABLE xxx RENAME */
16111611
elseif (pg_strcasecmp(prev4_wd,"ALTER")==0&&
@@ -1655,12 +1655,13 @@ psql_completion(const char *text, int start, int end)
16551655
COMPLETE_WITH_ATTR(prev3_wd,"");
16561656

16571657
/*
1658-
* If we have ALTER TABLE <sth> DROP|RENAME|VALIDATE CONSTRAINT, provide
1659-
* list of constraints
1658+
* If we have ALTER TABLE <sth>ALTER|DROP|RENAME|VALIDATE CONSTRAINT,
1659+
*providelist of constraints
16601660
*/
16611661
elseif (pg_strcasecmp(prev5_wd,"ALTER")==0&&
16621662
pg_strcasecmp(prev4_wd,"TABLE")==0&&
1663-
(pg_strcasecmp(prev2_wd,"DROP")==0||
1663+
(pg_strcasecmp(prev2_wd,"ALTER")==0||
1664+
pg_strcasecmp(prev2_wd,"DROP")==0||
16641665
pg_strcasecmp(prev2_wd,"RENAME")==0||
16651666
pg_strcasecmp(prev2_wd,"VALIDATE")==0)&&
16661667
pg_strcasecmp(prev_wd,"CONSTRAINT")==0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp