forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf3fd531
committed
Fix tab completion in psql for ALTER DEFAULT PRIVILEGES
When providing tab completion for ALTER DEFAULT PRIVILEGES, we areincluding the list of roles as possible options for completion after theGRANT or REVOKE. Further, we accept FOR ROLE/IN SCHEMA at the same timeand in either order, but the tab completion was only working for one orthe other. Lastly, we weren't using the actual list of allowed kinds ofobjects for default privileges for completion after the 'GRANT X ON' butinstead were completeing to what 'GRANT X ON' supports, which isn't thessame at all.Address these issues by improving the forward tab-completion for ALTERDEFAULT PRIVILEGES and then constrain and correct how the tailcompletion is done when it is for ALTER DEFAULT PRIVILEGES.Back-patch the forward/tail tab-completion to 9.6, where we made it easyto handle such cases.For 9.5 and earlier, correct the initial tab-completion to at least becorrect as far as it goes and then add a check for GRANT/REVOKE to onlytab-complete when the GRANT/REVOKE is the start of the command, so wedon't try to do tab-completion after we get to the GRANT/REVOKE part ofthe ALTER DEFAULT PRIVILEGES command, which is better than providingincorrect completions.Initial patch for master and 9.6 by Gilles Darold, though I cleaned itup and added a few comments. All bugs in the 9.5 and earlier patch aremine.Discussion:https://www.postgresql.org/message-id/1614593c-e356-5b27-6dba-66320a9bc68b@dalibo.com1 parentfe591f8 commitf3fd531
1 file changed
+48
-9
lines changedLines changed: 48 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1570 | 1570 |
| |
1571 | 1571 |
| |
1572 | 1572 |
| |
1573 |
| - | |
| 1573 | + | |
1574 | 1574 |
| |
1575 | 1575 |
| |
1576 |
| - | |
1577 |
| - | |
1578 |
| - | |
1579 |
| - | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
1580 | 1598 |
| |
1581 | 1599 |
| |
1582 | 1600 |
| |
| |||
2566 | 2584 |
| |
2567 | 2585 |
| |
2568 | 2586 |
| |
2569 |
| - | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
2570 | 2591 |
| |
2571 | 2592 |
| |
2572 |
| - | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
| 2596 | + | |
| 2597 | + | |
| 2598 | + | |
| 2599 | + | |
| 2600 | + | |
| 2601 | + | |
| 2602 | + | |
2573 | 2603 |
| |
2574 | 2604 |
| |
2575 | 2605 |
| |
| |||
2610 | 2640 |
| |
2611 | 2641 |
| |
2612 | 2642 |
| |
2613 |
| - | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
2614 | 2651 |
| |
2615 | 2652 |
| |
2616 | 2653 |
| |
| |||
2673 | 2710 |
| |
2674 | 2711 |
| |
2675 | 2712 |
| |
2676 |
| - | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
2677 | 2716 |
| |
2678 | 2717 |
| |
2679 | 2718 |
| |
|
0 commit comments
Comments
(0)