forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd6eb5a0
committed
Make psql's \password default to CURRENT_USER, not PQuser(conn).
The documentation says plainly that \password acts on "the current user"by default. What it actually acted on, or tried to, was the usernameused to log into the current session. This is not the same thing ifone has since done SET ROLE or SET SESSION AUTHENTICATION. Aside fromthe possible surprise factor, it's quite likely that the current roledoesn't have permissions to set the password of the original role.To fix, use "SELECT CURRENT_USER" to get the role name to act on.(This syntax works with servers at least back to 7.0.) Also, inhopes of reducing confusion, include the role name that will beacted on in the password prompt.The discrepancy from the documentation makes this a bug, soback-patch to all supported branches.Patch by me; thanks to Nathan Bossart for review.Discussion:https://postgr.es/m/747443.1635536754@sss.pgh.pa.us1 parentf8abb0f commitd6eb5a0
1 file changed
+21
-13
lines changedLines changed: 21 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2023 | 2023 |
| |
2024 | 2024 |
| |
2025 | 2025 |
| |
2026 |
| - | |
| 2026 | + | |
2027 | 2027 |
| |
2028 | 2028 |
| |
2029 | 2029 |
| |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
2030 | 2044 |
| |
2031 |
| - | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
2032 | 2049 |
| |
2033 | 2050 |
| |
2034 | 2051 |
| |
| |||
2038 | 2055 |
| |
2039 | 2056 |
| |
2040 | 2057 |
| |
2041 |
| - | |
2042 | 2058 |
| |
2043 | 2059 |
| |
2044 |
| - | |
2045 |
| - | |
2046 |
| - | |
2047 |
| - | |
2048 |
| - | |
2049 | 2060 |
| |
2050 | 2061 |
| |
2051 | 2062 |
| |
| |||
2055 | 2066 |
| |
2056 | 2067 |
| |
2057 | 2068 |
| |
2058 |
| - | |
2059 | 2069 |
| |
2060 | 2070 |
| |
2061 |
| - | |
2062 | 2071 |
| |
2063 | 2072 |
| |
2064 | 2073 |
| |
2065 | 2074 |
| |
2066 |
| - | |
2067 | 2075 |
| |
2068 | 2076 |
| |
2069 | 2077 |
| |
| |||
2072 | 2080 |
| |
2073 | 2081 |
| |
2074 | 2082 |
| |
2075 |
| - | |
2076 |
| - | |
| 2083 | + | |
2077 | 2084 |
| |
2078 | 2085 |
| |
| 2086 | + | |
2079 | 2087 |
| |
2080 | 2088 |
| |
2081 | 2089 |
| |
|
0 commit comments
Comments
(0)