forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3958abd
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 parentdb83c04 commit3958abd
2 files changed
+51
-17
lines changedLines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
921 | 921 |
| |
922 | 922 |
| |
923 | 923 |
| |
| 924 | + | |
| 925 | + | |
924 | 926 |
| |
925 | 927 |
| |
926 | 928 |
| |
|
Lines changed: 49 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2892 | 2892 |
| |
2893 | 2893 |
| |
2894 | 2894 |
| |
| 2895 | + | |
2895 | 2896 |
| |
2896 | 2897 |
| |
2897 | 2898 |
| |
| |||
2962 | 2963 |
| |
2963 | 2964 |
| |
2964 | 2965 |
| |
| 2966 | + | |
2965 | 2967 |
| |
2966 | 2968 |
| |
2967 | 2969 |
| |
| |||
2980 | 2982 |
| |
2981 | 2983 |
| |
2982 | 2984 |
| |
| 2985 | + | |
| 2986 | + | |
| 2987 | + | |
| 2988 | + | |
| 2989 | + | |
| 2990 | + | |
| 2991 | + | |
| 2992 | + | |
| 2993 | + | |
| 2994 | + | |
| 2995 | + | |
| 2996 | + | |
| 2997 | + | |
| 2998 | + | |
| 2999 | + | |
| 3000 | + | |
| 3001 | + | |
| 3002 | + | |
| 3003 | + | |
| 3004 | + | |
2983 | 3005 |
| |
2984 | 3006 |
| |
2985 | 3007 |
| |
| |||
2989 | 3011 |
| |
2990 | 3012 |
| |
2991 | 3013 |
| |
2992 |
| - | |
2993 |
| - | |
| 3014 | + | |
| 3015 | + | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
2994 | 3021 |
| |
2995 | 3022 |
| |
2996 | 3023 |
| |
| |||
3078 | 3105 |
| |
3079 | 3106 |
| |
3080 | 3107 |
| |
3081 |
| - | |
3082 |
| - | |
3083 |
| - | |
3084 |
| - | |
3085 |
| - | |
3086 |
| - | |
3087 |
| - | |
3088 |
| - | |
| 3108 | + | |
| 3109 | + | |
| 3110 | + | |
| 3111 | + | |
| 3112 | + | |
| 3113 | + | |
| 3114 | + | |
| 3115 | + | |
| 3116 | + | |
| 3117 | + | |
3089 | 3118 |
| |
3090 | 3119 |
| |
3091 | 3120 |
| |
| |||
3097 | 3126 |
| |
3098 | 3127 |
| |
3099 | 3128 |
| |
3100 |
| - | |
3101 |
| - | |
| 3129 | + | |
| 3130 | + | |
| 3131 | + | |
3102 | 3132 |
| |
3103 | 3133 |
| |
3104 |
| - | |
3105 |
| - | |
| 3134 | + | |
3106 | 3135 |
| |
3107 | 3136 |
| |
3108 | 3137 |
| |
| |||
3121 | 3150 |
| |
3122 | 3151 |
| |
3123 | 3152 |
| |
3124 |
| - | |
| 3153 | + | |
| 3154 | + | |
| 3155 | + | |
3125 | 3156 |
| |
3126 | 3157 |
| |
3127 | 3158 |
| |
3128 |
| - | |
3129 |
| - | |
| 3159 | + | |
| 3160 | + | |
| 3161 | + | |
3130 | 3162 |
| |
3131 | 3163 |
| |
3132 | 3164 |
| |
|
0 commit comments
Comments
(0)