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

Commit19b1511

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 parent0ec68a0 commit19b1511

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
@@ -1483,7 +1483,7 @@ psql_completion(const char *text, int start, int end)
14831483
elseif (pg_strcasecmp(prev4_wd,"ALTER")==0&&
14841484
pg_strcasecmp(prev3_wd,"TABLE")==0&&
14851485
pg_strcasecmp(prev_wd,"ALTER")==0)
1486-
COMPLETE_WITH_ATTR(prev2_wd," UNION SELECT 'COLUMN'");
1486+
COMPLETE_WITH_ATTR(prev2_wd," UNION SELECT 'COLUMN' UNION SELECT 'CONSTRAINT'");
14871487

14881488
/* ALTER TABLE xxx RENAME */
14891489
elseif (pg_strcasecmp(prev4_wd,"ALTER")==0&&
@@ -1533,12 +1533,13 @@ psql_completion(const char *text, int start, int end)
15331533
COMPLETE_WITH_ATTR(prev3_wd,"");
15341534

15351535
/*
1536-
* If we have ALTER TABLE <sth> DROP|RENAME|VALIDATE CONSTRAINT, provide
1537-
* list of constraints
1536+
* If we have ALTER TABLE <sth>ALTER|DROP|RENAME|VALIDATE CONSTRAINT,
1537+
*providelist of constraints
15381538
*/
15391539
elseif (pg_strcasecmp(prev5_wd,"ALTER")==0&&
15401540
pg_strcasecmp(prev4_wd,"TABLE")==0&&
1541-
(pg_strcasecmp(prev2_wd,"DROP")==0||
1541+
(pg_strcasecmp(prev2_wd,"ALTER")==0||
1542+
pg_strcasecmp(prev2_wd,"DROP")==0||
15421543
pg_strcasecmp(prev2_wd,"RENAME")==0||
15431544
pg_strcasecmp(prev2_wd,"VALIDATE")==0)&&
15441545
pg_strcasecmp(prev_wd,"CONSTRAINT")==0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp