forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitea80138
committed
Fix psql's \connect command some more.
Jasen Betts reported yet another unintended side effect of commit85c5428: reconnecting with "\c service=whatever" did not have theexpected results. The reason is that starting from the output ofPQconndefaults() effectively allows environment variables (suchas PGPORT) to override entries in the service file, whereas thenormal priority is the other way around.Not using PQconndefaults at all would require yet a third main codepath in do_connect's parameter setup, so I don't really want to fixit that way. But we can have the logic effectively ignore all thedefault values for just a couple more lines of code.This patch doesn't change the behavior for "\c -reuse-previous=onservice=whatever". That remains significantly different from before85c5428, because many more parameters will be re-used, and thusnot be possible for service entries to replace. But I think thisis (mostly?) intentional. In any case, since libpq does not reportwhere it got parameter values from, it's hard to do differently.Per bug #16936 from Jasen Betts. As with the previous patches,back-patch to all supported branches. (9.5 is unfortunately nowout of support, so this won't get fixed there.)Discussion:https://postgr.es/m/16936-3f524322a53a29f0@postgresql.org1 parent9d52311 commitea80138
1 file changed
+19
-0
lines changedLines changed: 19 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3132 | 3132 |
| |
3133 | 3133 |
| |
3134 | 3134 |
| |
| 3135 | + | |
| 3136 | + | |
| 3137 | + | |
| 3138 | + | |
| 3139 | + | |
| 3140 | + | |
| 3141 | + | |
| 3142 | + | |
| 3143 | + | |
| 3144 | + | |
| 3145 | + | |
| 3146 | + | |
| 3147 | + | |
| 3148 | + | |
| 3149 | + | |
| 3150 | + | |
| 3151 | + | |
| 3152 | + | |
| 3153 | + | |
3135 | 3154 |
| |
3136 | 3155 |
| |
3137 | 3156 |
| |
|
0 commit comments
Comments
(0)