@@ -1622,12 +1622,12 @@ psql_completion(char *text, int start, int end)
1622
1622
COMPLETE_WITH_CONST ("IDENTITY" );
1623
1623
}
1624
1624
1625
- /* ALTER TABLESPACE <foo> with RENAME TO, OWNER TO, SET, RESET */
1625
+ /* ALTER TABLESPACE <foo> with RENAME TO, OWNER TO, SET, RESET, MOVE */
1626
1626
else if (pg_strcasecmp (prev3_wd ,"ALTER" )== 0 &&
1627
1627
pg_strcasecmp (prev2_wd ,"TABLESPACE" )== 0 )
1628
1628
{
1629
1629
static const char * const list_ALTERTSPC []=
1630
- {"RENAME TO" ,"OWNER TO" ,"SET" ,"RESET" ,NULL };
1630
+ {"RENAME TO" ,"OWNER TO" ,"SET" ,"RESET" ,"MOVE" , NULL };
1631
1631
1632
1632
COMPLETE_WITH_LIST (list_ALTERTSPC );
1633
1633
}
@@ -1649,6 +1649,27 @@ psql_completion(char *text, int start, int end)
1649
1649
1650
1650
COMPLETE_WITH_LIST (list_TABLESPACEOPTIONS );
1651
1651
}
1652
+ /* ALTER TABLESPACE <foo> MOVE ALL|TABLES|INDEXES|MATERIALIZED VIEWS */
1653
+ else if (pg_strcasecmp (prev4_wd ,"ALTER" )== 0 &&
1654
+ pg_strcasecmp (prev3_wd ,"TABLESPACE" )== 0 &&
1655
+ pg_strcasecmp (prev_wd ,"MOVE" )== 0 )
1656
+ {
1657
+ static const char * const list_TABLESPACEMOVETARGETS []=
1658
+ {"ALL" ,"TABLES" ,"INDEXES" ,"MATERIALIZED VIEWS" ,NULL };
1659
+
1660
+ COMPLETE_WITH_LIST (list_TABLESPACEMOVETARGETS );
1661
+ }
1662
+ else if ((pg_strcasecmp (prev4_wd ,"TABLESPACE" )== 0 &&
1663
+ pg_strcasecmp (prev2_wd ,"MOVE" )== 0 )||
1664
+ (pg_strcasecmp (prev5_wd ,"TABLESPACE" )== 0 &&
1665
+ pg_strcasecmp (prev3_wd ,"MOVE" )== 0 &&
1666
+ pg_strcasecmp (prev2_wd ,"MATERIALIZED" )== 0 ))
1667
+ {
1668
+ static const char * const list_TABLESPACEMOVEOPTIONS []=
1669
+ {"OWNED BY" ,"TO" ,NULL };
1670
+
1671
+ COMPLETE_WITH_LIST (list_TABLESPACEMOVEOPTIONS );
1672
+ }
1652
1673
1653
1674
/* ALTER TEXT SEARCH */
1654
1675
else if (pg_strcasecmp (prev3_wd ,"ALTER" )== 0 &&
@@ -2559,8 +2580,9 @@ psql_completion(char *text, int start, int end)
2559
2580
* but we may as well tab-complete both: perhaps some users prefer one
2560
2581
* variant or the other.
2561
2582
*/
2562
- else if (pg_strcasecmp (prev3_wd ,"FETCH" )== 0 ||
2563
- pg_strcasecmp (prev3_wd ,"MOVE" )== 0 )
2583
+ else if ((pg_strcasecmp (prev3_wd ,"FETCH" )== 0 ||
2584
+ pg_strcasecmp (prev3_wd ,"MOVE" )== 0 )&&
2585
+ pg_strcasecmp (prev_wd ,"TO" )!= 0 )
2564
2586
{
2565
2587
static const char * const list_FROMIN []=
2566
2588
{"FROM" ,"IN" ,NULL };