forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitfd6cd69
committed
Clean up psql's behavior for a few more control variables.
Modify FETCH_COUNT to always have a defined value, like other controlvariables, mainly so it will always appear in "\set" output.Add hooks to force HISTSIZE to be defined and require it to have aninteger value. (I don't see any point in allowing it to be set tonon-integral values.)Add hooks to force IGNOREEOF to be defined and require it to have aninteger value. Unlike the other cases, here we're trying to bebug-compatible with a rather bogus externally-defined behavior, so I thinkwe need to continue to allow "\set IGNOREEOF whatever". Fix it so thatthe substitution hook silently replace non-numeric values with "10",so that the stored value always reflects what we're really doing.Add a dummy assign hook for HISTFILE, just so it's always invariables.c's list. We can't require it to be defined always, becausethat would break the interaction with the PSQL_HISTORY environmentvariable, so there isn't any change in visible behavior here.Remove tab-complete.c's private list of known variable names, since that'sreally a maintenance nuisance. Given the preceding changes, there are nocontrol variables it won't show anyway. This does mean that if for somereason you've unset one of the status variables (DBNAME, HOST, etc), thatvariable would not appear in tab completion for \set. But I think that'sfine, for at least two reasons: we shouldn't be encouraging people to usethose variables as regular variables, and if someone does do so anyway,why shouldn't it act just like a regular variable?Remove ugly and no-longer-used-anywhere GetVariableNum(). In general,future additions of integer-valued control variables should follow theparadigm of adding an assign hook using ParseVariableNum(), so there'sno reason to expect we'd need this again later.Discussion:https://postgr.es/m/17516.1485973973@sss.pgh.pa.us1 parent8ac0365 commitfd6cd69
File tree
9 files changed
+90
-80
lines changed- doc/src/sgml/ref
- src/bin/psql
9 files changed
+90
-80
lines changedLines changed: 7 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3247 | 3247 |
| |
3248 | 3248 |
| |
3249 | 3249 |
| |
3250 |
| - | |
3251 |
| - | |
3252 |
| - | |
3253 |
| - | |
3254 |
| - | |
3255 |
| - | |
3256 | 3250 |
| |
3257 | 3251 |
| |
3258 | 3252 |
| |
| |||
3316 | 3310 |
| |
3317 | 3311 |
| |
3318 | 3312 |
| |
3319 |
| - | |
3320 |
| - | |
3321 |
| - | |
3322 |
| - | |
| 3313 | + | |
| 3314 | + | |
3323 | 3315 |
| |
3324 | 3316 |
| |
3325 | 3317 |
| |
| |||
3345 | 3337 |
| |
3346 | 3338 |
| |
3347 | 3339 |
| |
3348 |
| - | |
| 3340 | + | |
3349 | 3341 |
| |
3350 | 3342 |
| |
3351 |
| - | |
3352 |
| - | |
3353 |
| - | |
3354 |
| - | |
| 3343 | + | |
| 3344 | + | |
| 3345 | + | |
| 3346 | + | |
3355 | 3347 |
| |
3356 | 3348 |
| |
3357 | 3349 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
348 | 348 |
| |
349 | 349 |
| |
350 | 350 |
| |
351 |
| - | |
| 351 | + | |
352 | 352 |
| |
353 |
| - | |
| 353 | + | |
354 | 354 |
| |
355 | 355 |
| |
356 | 356 |
| |
|
Lines changed: 1 addition & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
539 | 539 |
| |
540 | 540 |
| |
541 | 541 |
| |
542 |
| - | |
543 |
| - | |
544 |
| - | |
545 |
| - | |
| 542 | + | |
546 | 543 |
| |
547 | 544 |
| |
548 | 545 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
162 | 162 |
| |
163 | 163 |
| |
164 | 164 |
| |
165 |
| - | |
| 165 | + | |
166 | 166 |
| |
167 | 167 |
| |
168 | 168 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
125 | 125 |
| |
126 | 126 |
| |
127 | 127 |
| |
| 128 | + | |
| 129 | + | |
128 | 130 |
| |
129 | 131 |
| |
130 | 132 |
| |
|
Lines changed: 74 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
774 | 774 |
| |
775 | 775 |
| |
776 | 776 |
| |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
777 | 782 |
| |
778 | 783 |
| |
779 | 784 |
| |
| |||
823 | 828 |
| |
824 | 829 |
| |
825 | 830 |
| |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
826 | 839 |
| |
827 | 840 |
| |
828 | 841 |
| |
829 |
| - | |
830 |
| - | |
831 |
| - | |
832 |
| - | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
833 | 852 |
| |
834 | 853 |
| |
835 | 854 |
| |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
836 | 896 |
| |
837 | 897 |
| |
838 | 898 |
| |
| |||
1062 | 1122 |
| |
1063 | 1123 |
| |
1064 | 1124 |
| |
1065 |
| - | |
| 1125 | + | |
1066 | 1126 |
| |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
1067 | 1136 |
| |
1068 | 1137 |
| |
1069 | 1138 |
| |
|
Lines changed: 3 additions & 23 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3775 | 3775 |
| |
3776 | 3776 |
| |
3777 | 3777 |
| |
3778 |
| - | |
3779 |
| - | |
| 3778 | + | |
| 3779 | + | |
| 3780 | + | |
3780 | 3781 |
| |
3781 | 3782 |
| |
3782 | 3783 |
| |
| |||
3789 | 3790 |
| |
3790 | 3791 |
| |
3791 | 3792 |
| |
3792 |
| - | |
3793 |
| - | |
3794 |
| - | |
3795 |
| - | |
3796 |
| - | |
3797 |
| - | |
3798 |
| - | |
3799 |
| - | |
3800 |
| - | |
3801 | 3793 |
| |
3802 | 3794 |
| |
3803 |
| - | |
3804 |
| - | |
3805 |
| - | |
3806 |
| - | |
3807 |
| - | |
3808 |
| - | |
3809 |
| - | |
3810 | 3795 |
| |
3811 | 3796 |
| |
3812 | 3797 |
| |
3813 | 3798 |
| |
3814 |
| - | |
3815 |
| - | |
3816 |
| - | |
3817 |
| - | |
3818 |
| - | |
3819 | 3799 |
| |
3820 | 3800 |
| |
3821 | 3801 |
| |
|
Lines changed: 0 additions & 25 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
179 | 179 |
| |
180 | 180 |
| |
181 | 181 |
| |
182 |
| - | |
183 |
| - | |
184 |
| - | |
185 |
| - | |
186 |
| - | |
187 |
| - | |
188 |
| - | |
189 |
| - | |
190 |
| - | |
191 |
| - | |
192 |
| - | |
193 |
| - | |
194 |
| - | |
195 |
| - | |
196 |
| - | |
197 |
| - | |
198 |
| - | |
199 |
| - | |
200 |
| - | |
201 |
| - | |
202 |
| - | |
203 |
| - | |
204 |
| - | |
205 |
| - | |
206 |
| - | |
207 | 182 |
| |
208 | 183 |
| |
209 | 184 |
| |
|
Lines changed: 0 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
81 | 81 |
| |
82 | 82 |
| |
83 | 83 |
| |
84 |
| - | |
85 |
| - | |
86 |
| - | |
87 |
| - | |
88 |
| - | |
89 | 84 |
| |
90 | 85 |
| |
91 | 86 |
| |
|
0 commit comments
Comments
(0)