- Notifications
You must be signed in to change notification settings - Fork5
Commite146ca6
committed
psql: fix \connect with URIs and conninfo strings
This is the second try at this, afterfcef161 failed miserably andhad to be reverted: as it turns out, libpq cannot depend on libpgcommonafter all. Instead of shuffling code in the master branch, make that onejust like 9.4 and accept the duplication. (This was all my own mistake,not the patch submitter's).psql was already accepting conninfo strings as the first parameter in\connect, but the way it worked wasn't sane; some of the otherparameters would get the previous connection's values, causing it toconnect to a completely unexpected server or, more likely, not findingany server at all because of completely wrong combinations ofparameters.Fix by explicitely checking for a conninfo-looking parameter in thedbname position; if one is found, use its complete specification ratherthan mix with the other arguments. Also, change tab-completion to nottry to complete conninfo/URI-looking "dbnames" and document thatconninfos are accepted as first argument.There was a weak consensus to backpatch this, because while the behaviorof using the dbname as a conninfo is nowhere documented for \connect, itis reasonable to expect that it works because it does work in many othercontexts. Therefore this is backpatched all the way back to 9.0.Author: David Fetter, Andrew Dunstan. Some editorialization by me(probably earning a Gierth's "Sloppy" badge in the process.)Reviewers: Andrew Gierth, Erik Rijkers, Pavel Stěhule, Stephen Frost,Robert Haas, Andrew Dunstan.1 parentf272098 commite146ca6
File tree
7 files changed
+142
-39
lines changed- doc/src/sgml/ref
- src
- bin/psql
- interfaces/libpq
7 files changed
+142
-39
lines changedLines changed: 29 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
796 | 796 |
| |
797 | 797 |
| |
798 | 798 |
| |
799 |
| - | |
| 799 | + | |
800 | 800 |
| |
801 | 801 |
| |
802 | 802 |
| |
803 |
| - | |
804 |
| - | |
805 |
| - | |
806 |
| - | |
807 |
| - | |
808 |
| - | |
809 |
| - | |
810 |
| - | |
811 |
| - | |
812 |
| - | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
813 | 806 |
| |
814 | 807 |
| |
815 | 808 |
| |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
816 | 824 |
| |
817 | 825 |
| |
818 | 826 |
| |
| |||
822 | 830 |
| |
823 | 831 |
| |
824 | 832 |
| |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
825 | 843 |
| |
826 | 844 |
| |
827 | 845 |
| |
|
Lines changed: 56 additions & 23 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1608 | 1608 |
| |
1609 | 1609 |
| |
1610 | 1610 |
| |
| 1611 | + | |
| 1612 | + | |
1611 | 1613 |
| |
1612 | 1614 |
| |
1613 | 1615 |
| |
| |||
1621 | 1623 |
| |
1622 | 1624 |
| |
1623 | 1625 |
| |
1624 |
| - | |
1625 |
| - | |
| 1626 | + | |
1626 | 1627 |
| |
1627 | 1628 |
| |
1628 | 1629 |
| |
1629 | 1630 |
| |
1630 | 1631 |
| |
1631 | 1632 |
| |
1632 | 1633 |
| |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
1633 | 1655 |
| |
1634 | 1656 |
| |
1635 | 1657 |
| |
| |||
1644 | 1666 |
| |
1645 | 1667 |
| |
1646 | 1668 |
| |
1647 |
| - | |
| 1669 | + | |
1648 | 1670 |
| |
1649 |
| - | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
1650 | 1676 |
| |
1651 | 1677 |
| |
1652 | 1678 |
| |
1653 | 1679 |
| |
1654 | 1680 |
| |
1655 | 1681 |
| |
1656 | 1682 |
| |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
1657 | 1703 |
| |
1658 |
| - | |
1659 |
| - | |
1660 |
| - | |
1661 |
| - | |
1662 |
| - | |
1663 |
| - | |
1664 |
| - | |
1665 |
| - | |
1666 |
| - | |
1667 |
| - | |
1668 |
| - | |
1669 |
| - | |
1670 |
| - | |
1671 |
| - | |
1672 |
| - | |
1673 |
| - | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
1674 | 1707 |
| |
1675 | 1708 |
| |
1676 | 1709 |
| |
1677 |
| - | |
1678 |
| - | |
| 1710 | + | |
| 1711 | + | |
1679 | 1712 |
| |
1680 | 1713 |
| |
1681 | 1714 |
| |
1682 |
| - | |
| 1715 | + | |
1683 | 1716 |
| |
1684 | 1717 |
| |
1685 | 1718 |
| |
|
Lines changed: 41 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1846 | 1846 |
| |
1847 | 1847 |
| |
1848 | 1848 |
| |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + |
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
| 49 | + | |
| 50 | + | |
49 | 51 |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
260 | 260 |
| |
261 | 261 |
| |
262 | 262 |
| |
263 |
| - | |
| 263 | + | |
264 | 264 |
| |
265 | 265 |
| |
266 | 266 |
| |
267 |
| - | |
| 267 | + | |
268 | 268 |
| |
269 | 269 |
| |
270 | 270 |
| |
|
Lines changed: 8 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3707 | 3707 |
| |
3708 | 3708 |
| |
3709 | 3709 |
| |
3710 |
| - | |
| 3710 | + | |
| 3711 | + | |
| 3712 | + | |
| 3713 | + | |
3711 | 3714 |
| |
3712 |
| - | |
3713 |
| - | |
| 3715 | + | |
| 3716 | + | |
| 3717 | + | |
| 3718 | + | |
3714 | 3719 |
| |
3715 | 3720 |
| |
3716 | 3721 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4197 | 4197 |
| |
4198 | 4198 |
| |
4199 | 4199 |
| |
| 4200 | + | |
| 4201 | + | |
4200 | 4202 |
| |
4201 | 4203 |
| |
4202 | 4204 |
| |
| |||
4218 | 4220 |
| |
4219 | 4221 |
| |
4220 | 4222 |
| |
| 4223 | + | |
| 4224 | + | |
4221 | 4225 |
| |
4222 | 4226 |
| |
4223 | 4227 |
| |
|
0 commit comments
Comments
(0)