forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2600e44
committed
Improve consistency of parsing of psql's magic variables.
For simple boolean variables such as ON_ERROR_STOP, psql has for a longtime recognized variant spellings of "on" and "off" (such as "1"/"0"),and it also made a point of warning you if you'd misspelled the setting.But these conveniences did not exist for other keyword-valued variables.In particular, though ECHO_HIDDEN and ON_ERROR_ROLLBACK include "on" and"off" as possible values, none of the alternative spellings for those wererecognized; and to make matters worse the code would just silently assume"on" was meant for any unrecognized spelling. Several people have reportedgetting bitten by this, so let's fix it. In detail, this patch:* Allows all spellings recognized by ParseVariableBool() for ECHO_HIDDENand ON_ERROR_ROLLBACK.* Reports a warning for unrecognized values for COMP_KEYWORD_CASE, ECHO,ECHO_HIDDEN, HISTCONTROL, ON_ERROR_ROLLBACK, and VERBOSITY.* Recognizes all values for all these variables case-insensitively;previously there was a mishmash of case-sensitive and case-insensitivebehaviors.Back-patch to all supported branches. There is a small risk of breakingexisting scripts that were accidentally failing to malfunction; but theconsensus is that the chance of detecting real problems and preventingfuture mistakes outweighs this.1 parent9b74f35 commit2600e44
File tree
5 files changed
+81
-53
lines changed- doc/src/sgml/ref
- src/bin/psql
5 files changed
+81
-53
lines changedLines changed: 22 additions & 21 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
157 | 157 |
| |
158 | 158 |
| |
159 | 159 |
| |
160 |
| - | |
161 |
| - | |
| 160 | + | |
162 | 161 |
| |
163 | 162 |
| |
164 | 163 |
| |
| |||
317 | 316 |
| |
318 | 317 |
| |
319 | 318 |
| |
320 |
| - | |
321 |
| - | |
| 319 | + | |
| 320 | + | |
322 | 321 |
| |
323 | 322 |
| |
324 | 323 |
| |
| |||
2455 | 2454 |
| |
2456 | 2455 |
| |
2457 | 2456 |
| |
2458 |
| - | |
2459 |
| - | |
| 2457 | + | |
| 2458 | + | |
| 2459 | + | |
2460 | 2460 |
| |
2461 | 2461 |
| |
2462 | 2462 |
| |
| |||
2614 | 2614 |
| |
2615 | 2615 |
| |
2616 | 2616 |
| |
2617 |
| - | |
| 2617 | + | |
2618 | 2618 |
| |
2619 |
| - | |
| 2619 | + | |
2620 | 2620 |
| |
2621 |
| - | |
| 2621 | + | |
2622 | 2622 |
| |
2623 |
| - | |
| 2623 | + | |
2624 | 2624 |
| |
2625 |
| - | |
2626 |
| - | |
| 2625 | + | |
| 2626 | + | |
2627 | 2627 |
| |
2628 | 2628 |
| |
2629 | 2629 |
| |
| |||
2636 | 2636 |
| |
2637 | 2637 |
| |
2638 | 2638 |
| |
2639 |
| - | |
2640 |
| - | |
2641 |
| - | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
2642 | 2643 |
| |
2643 | 2644 |
| |
2644 | 2645 |
| |
| |||
2677 | 2678 |
| |
2678 | 2679 |
| |
2679 | 2680 |
| |
2680 |
| - | |
2681 |
| - | |
| 2681 | + | |
| 2682 | + | |
2682 | 2683 |
| |
2683 | 2684 |
| |
2684 | 2685 |
| |
| |||
2688 | 2689 |
| |
2689 | 2690 |
| |
2690 | 2691 |
| |
2691 |
| - | |
2692 |
| - | |
| 2692 | + | |
| 2693 | + | |
2693 | 2694 |
| |
2694 | 2695 |
| |
2695 | 2696 |
| |
| |||
2698 | 2699 |
| |
2699 | 2700 |
| |
2700 | 2701 |
| |
2701 |
| - | |
2702 |
| - | |
| 2702 | + | |
| 2703 | + | |
2703 | 2704 |
| |
2704 | 2705 |
| |
2705 | 2706 |
| |
|
Lines changed: 11 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1025 | 1025 |
| |
1026 | 1026 |
| |
1027 | 1027 |
| |
1028 |
| - | |
| 1028 | + | |
1029 | 1029 |
| |
1030 | 1030 |
| |
1031 | 1031 |
| |
| |||
1882 | 1882 |
| |
1883 | 1883 |
| |
1884 | 1884 |
| |
1885 |
| - | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
1886 | 1888 |
| |
1887 | 1889 |
| |
1888 |
| - | |
| 1890 | + | |
1889 | 1891 |
| |
1890 | 1892 |
| |
1891 | 1893 |
| |
| |||
1898 | 1900 |
| |
1899 | 1901 |
| |
1900 | 1902 |
| |
1901 |
| - | |
| 1903 | + | |
1902 | 1904 |
| |
1903 | 1905 |
| |
1904 | 1906 |
| |
| |||
1955 | 1957 |
| |
1956 | 1958 |
| |
1957 | 1959 |
| |
1958 |
| - | |
| 1960 | + | |
1959 | 1961 |
| |
1960 | 1962 |
| |
1961 | 1963 |
| |
| |||
2009 | 2011 |
| |
2010 | 2012 |
| |
2011 | 2013 |
| |
2012 |
| - | |
| 2014 | + | |
| 2015 | + | |
2013 | 2016 |
| |
2014 | 2017 |
| |
2015 | 2018 |
| |
| 2019 | + | |
2016 | 2020 |
| |
2017 | 2021 |
| |
2018 | 2022 |
| |
| |||
2032 | 2036 |
| |
2033 | 2037 |
| |
2034 | 2038 |
| |
2035 |
| - | |
| 2039 | + | |
2036 | 2040 |
| |
2037 | 2041 |
| |
2038 | 2042 |
| |
|
Lines changed: 36 additions & 20 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
631 | 631 |
| |
632 | 632 |
| |
633 | 633 |
| |
634 |
| - | |
| 634 | + | |
635 | 635 |
| |
636 | 636 |
| |
637 | 637 |
| |
638 | 638 |
| |
639 | 639 |
| |
640 |
| - | |
| 640 | + | |
641 | 641 |
| |
642 | 642 |
| |
643 | 643 |
| |
644 | 644 |
| |
645 | 645 |
| |
646 |
| - | |
| 646 | + | |
647 | 647 |
| |
648 | 648 |
| |
649 | 649 |
| |
650 | 650 |
| |
651 | 651 |
| |
652 |
| - | |
| 652 | + | |
653 | 653 |
| |
654 | 654 |
| |
655 | 655 |
| |
656 | 656 |
| |
657 | 657 |
| |
658 |
| - | |
| 658 | + | |
659 | 659 |
| |
660 | 660 |
| |
661 | 661 |
| |
| |||
669 | 669 |
| |
670 | 670 |
| |
671 | 671 |
| |
672 |
| - | |
| 672 | + | |
673 | 673 |
| |
674 |
| - | |
| 674 | + | |
675 | 675 |
| |
| 676 | + | |
| 677 | + | |
676 | 678 |
| |
| 679 | + | |
| 680 | + | |
| 681 | + | |
677 | 682 |
| |
| 683 | + | |
678 | 684 |
| |
679 | 685 |
| |
680 | 686 |
| |
681 | 687 |
| |
682 | 688 |
| |
683 | 689 |
| |
684 | 690 |
| |
685 |
| - | |
| 691 | + | |
686 | 692 |
| |
687 |
| - | |
688 |
| - | |
689 |
| - | |
| 693 | + | |
690 | 694 |
| |
| 695 | + | |
| 696 | + | |
691 | 697 |
| |
692 | 698 |
| |
693 | 699 |
| |
| |||
697 | 703 |
| |
698 | 704 |
| |
699 | 705 |
| |
700 |
| - | |
701 |
| - | |
702 |
| - | |
| 706 | + | |
703 | 707 |
| |
| 708 | + | |
| 709 | + | |
704 | 710 |
| |
705 | 711 |
| |
706 | 712 |
| |
707 | 713 |
| |
708 | 714 |
| |
709 | 715 |
| |
710 | 716 |
| |
711 |
| - | |
| 717 | + | |
712 | 718 |
| |
713 |
| - | |
| 719 | + | |
714 | 720 |
| |
715 |
| - | |
| 721 | + | |
716 | 722 |
| |
| 723 | + | |
| 724 | + | |
717 | 725 |
| |
| 726 | + | |
| 727 | + | |
| 728 | + | |
718 | 729 |
| |
| 730 | + | |
719 | 731 |
| |
720 | 732 |
| |
721 | 733 |
| |
| |||
741 | 753 |
| |
742 | 754 |
| |
743 | 755 |
| |
744 |
| - | |
| 756 | + | |
745 | 757 |
| |
746 |
| - | |
| 758 | + | |
747 | 759 |
| |
748 |
| - | |
| 760 | + | |
749 | 761 |
| |
750 | 762 |
| |
| 763 | + | |
| 764 | + | |
| 765 | + | |
751 | 766 |
| |
| 767 | + | |
752 | 768 |
| |
753 | 769 |
| |
754 | 770 |
| |
|
Lines changed: 11 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
52 |
| - | |
53 |
| - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
54 | 59 |
| |
55 | 60 |
| |
56 |
| - | |
| 61 | + | |
57 | 62 |
| |
58 | 63 |
| |
59 | 64 |
| |
| |||
82 | 87 |
| |
83 | 88 |
| |
84 | 89 |
| |
85 |
| - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
86 | 93 |
| |
87 | 94 |
| |
88 | 95 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
39 | 39 |
| |
40 | 40 |
| |
41 | 41 |
| |
42 |
| - | |
| 42 | + | |
43 | 43 |
| |
44 | 44 |
| |
45 | 45 |
| |
|
0 commit comments
Comments
(0)