Commit 72b930f
committed
Fix recently-introduced breakage in psql's \connect command.
Through my misreading of what the existing code actually did,
commits 85c54287a et al. broke psql's behavior for the case where
"\c connstring" provides a password in the connstring. We should
use that password in such a case, but as of 85c54287a we ignored it
(and instead, prompted for a password).
Commit 94929f1cf fixed that in HEAD, but since I thought it was
cleaning up a longstanding misbehavior and not one I'd just created,
I didn't back-patch it.
Hence, back-patch the portions of 94929f1cf having to do with
password management. In addition to fixing the introduced bug,
this means that "\c -reuse-previous=on connstring" will allow
re-use of an existing connection's password if the connstring
doesn't change user/host/port. That didn't happen before, but
it seems like a bug fix, and anyway I'm loath to have significant
differences in this code across versions.
Also fix an error with the same root cause about whether or not to
override a connstring's setting of client_encoding. As of 85c54287a
we always did so; restore the previous behavior of overriding only
when stdin/stdout are a terminal and there's no environment setting
of PGCLIENTENCODING. (I find that definition a bit surprising, but
right now doesn't seem like the time to revisit it.)
Per bug #16746 from Krzysztof Gradek. As with the previous patch,
back-patch to all supported branches.
Discussion: https://postgr.es/m/16746-44b30e2edf4335d4@postgresql.org1 parent 1eb499a commit 72b930f
2 files changed
+51
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
920 | 920 | | |
921 | 921 | | |
922 | 922 | | |
| 923 | + | |
| 924 | + | |
923 | 925 | | |
924 | 926 | | |
925 | 927 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3031 | 3031 | | |
3032 | 3032 | | |
3033 | 3033 | | |
| 3034 | + | |
3034 | 3035 | | |
3035 | 3036 | | |
3036 | 3037 | | |
| |||
3101 | 3102 | | |
3102 | 3103 | | |
3103 | 3104 | | |
| 3105 | + | |
3104 | 3106 | | |
3105 | 3107 | | |
3106 | 3108 | | |
| |||
3119 | 3121 | | |
3120 | 3122 | | |
3121 | 3123 | | |
| 3124 | + | |
| 3125 | + | |
| 3126 | + | |
| 3127 | + | |
| 3128 | + | |
| 3129 | + | |
| 3130 | + | |
| 3131 | + | |
| 3132 | + | |
| 3133 | + | |
| 3134 | + | |
| 3135 | + | |
| 3136 | + | |
| 3137 | + | |
| 3138 | + | |
| 3139 | + | |
| 3140 | + | |
| 3141 | + | |
| 3142 | + | |
| 3143 | + | |
3122 | 3144 | | |
3123 | 3145 | | |
3124 | 3146 | | |
| |||
3128 | 3150 | | |
3129 | 3151 | | |
3130 | 3152 | | |
3131 | | - | |
3132 | | - | |
| 3153 | + | |
| 3154 | + | |
| 3155 | + | |
| 3156 | + | |
| 3157 | + | |
| 3158 | + | |
| 3159 | + | |
3133 | 3160 | | |
3134 | 3161 | | |
3135 | 3162 | | |
| |||
3217 | 3244 | | |
3218 | 3245 | | |
3219 | 3246 | | |
3220 | | - | |
3221 | | - | |
3222 | | - | |
3223 | | - | |
3224 | | - | |
3225 | | - | |
3226 | | - | |
3227 | | - | |
| 3247 | + | |
| 3248 | + | |
| 3249 | + | |
| 3250 | + | |
| 3251 | + | |
| 3252 | + | |
| 3253 | + | |
| 3254 | + | |
| 3255 | + | |
| 3256 | + | |
3228 | 3257 | | |
3229 | 3258 | | |
3230 | 3259 | | |
| |||
3236 | 3265 | | |
3237 | 3266 | | |
3238 | 3267 | | |
3239 | | - | |
3240 | | - | |
| 3268 | + | |
| 3269 | + | |
| 3270 | + | |
3241 | 3271 | | |
3242 | 3272 | | |
3243 | | - | |
3244 | | - | |
| 3273 | + | |
3245 | 3274 | | |
3246 | 3275 | | |
3247 | 3276 | | |
| |||
3260 | 3289 | | |
3261 | 3290 | | |
3262 | 3291 | | |
3263 | | - | |
| 3292 | + | |
| 3293 | + | |
| 3294 | + | |
3264 | 3295 | | |
3265 | 3296 | | |
3266 | 3297 | | |
3267 | | - | |
3268 | | - | |
| 3298 | + | |
| 3299 | + | |
| 3300 | + | |
3269 | 3301 | | |
3270 | 3302 | | |
3271 | 3303 | | |
| |||
0 commit comments