forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7e5e1bb
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 parentd5e2bdf commit7e5e1bb
1 file changed
+14
-2
lines changedLines changed: 14 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3030 | 3030 |
| |
3031 | 3031 |
| |
3032 | 3032 |
| |
| 3033 | + | |
3033 | 3034 |
| |
3034 | 3035 |
| |
3035 | 3036 |
| |
| |||
3239 | 3240 |
| |
3240 | 3241 |
| |
3241 | 3242 |
| |
| 3243 | + | |
| 3244 | + | |
| 3245 | + | |
| 3246 | + | |
| 3247 | + | |
| 3248 | + | |
| 3249 | + | |
| 3250 | + | |
| 3251 | + | |
| 3252 | + | |
3242 | 3253 |
| |
3243 | 3254 |
| |
3244 | 3255 |
| |
| |||
3279 | 3290 |
| |
3280 | 3291 |
| |
3281 | 3292 |
| |
3282 |
| - | |
3283 |
| - | |
| 3293 | + | |
| 3294 | + | |
| 3295 | + | |
3284 | 3296 |
| |
3285 | 3297 |
| |
3286 | 3298 |
| |
|
0 commit comments
Comments
(0)