forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit72b930f
committed
Fix recently-introduced breakage in psql's \connect command.
Through my misreading of what the existing code actually did,commits85c5428 et al. broke psql's behavior for the case where"\c connstring" provides a password in the connstring. We shoulduse that password in such a case, but as of85c5428 we ignored it(and instead, prompted for a password).Commit94929f1 fixed that in HEAD, but since I thought it wascleaning up a longstanding misbehavior and not one I'd just created,I didn't back-patch it.Hence, back-patch the portions of94929f1 having to do withpassword management. In addition to fixing the introduced bug,this means that "\c -reuse-previous=on connstring" will allowre-use of an existing connection's password if the connstringdoesn't change user/host/port. That didn't happen before, butit seems like a bug fix, and anyway I'm loath to have significantdifferences in this code across versions.Also fix an error with the same root cause about whether or not tooverride a connstring's setting of client_encoding. As of85c5428we always did so; restore the previous behavior of overriding onlywhen stdin/stdout are a terminal and there's no environment settingof PGCLIENTENCODING. (I find that definition a bit surprising, butright 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 parent1eb499a commit72b930f
2 files changed
+51
-17
lines changedLines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
920 | 920 |
| |
921 | 921 |
| |
922 | 922 |
| |
| 923 | + | |
| 924 | + | |
923 | 925 |
| |
924 | 926 |
| |
925 | 927 |
| |
|
Lines changed: 49 additions & 17 deletions
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
Comments
(0)