Thread
Commits
-
Fix recently-introduced breakage in psql's \connect command.
- e2d5de15003d 9.5.25 landed
- 946277fd42d4 10.16 landed
- 7e5e1bba034e 14.0 landed
- 777ac03a6823 11.11 landed
- 72b930f5045e 13.2 landed
- 3f59a05f0fa8 9.6.21 landed
- 3958abdad337 12.6 landed
-
Doc: clarify behavior of PQconnectdbParams().
- db83c0450929 12.6 landed
- d5e2bdf7dda7 14.0 landed
- bc3b4c8ca152 10.16 landed
- 7fbd1442807a 9.6.21 landed
- 5fe3e9333287 11.11 landed
- 414fb255e55f 9.5.25 landed
- 1eb499a8a5e6 13.2 landed
-
Allow psql to re-use connection parameters after a connection loss.
- 1b62d0fb3e50 14.0 cited
-
Clean up some unpleasant behaviors in psql's \connect command.
- 94929f1cf6cb 14.0 cited
-
Fix connection string handling in psql's \connect command.
- 85c54287af56 14.0 cited
-
BUG #16746: [PG12.5 psql] Password ignored by connect meta-command
The Post Office <noreply@postgresql.org> — 2020-11-26T10:47:41Z
The following bug has been logged on the website: Bug reference: 16746 Logged by: Krzysztof Gradek Email address: kgradekx@gmail.com PostgreSQL version: 12.5 Operating system: Centos Description: Hi I just migrated my app to PG 12.5 and jumped into an issue which didn't exist in PG12.3: the password provided in connection URI is ignored by connect meta-command. Steps to reproduce: 1. open PG12.5 psql 2. run connect command using connection URI -> instead of opening the connection I get password prompt. $ psql psql (12.5) Type "help" for help. postgres=# \connect postgresql://ph_quartz_user:password@127.0.0.1/ph_quartz Password for user ph_quartz_user: Same sequence using earlier version: $ /usr/pgsql-9.4/bin/psql psql (9.4.4, server 12.5) WARNING: psql major version 9.4, server major version 12.0. Some psql features might not work. Type "help" for help. postgres=# \connect postgresql://ph_quartz_user:password@127.0.0.1/ph_quartz psql (9.4.4, server 12.5) WARNING: psql major version 9.4, server major version 12.0. Some psql features might not work. You are now connected to database "ph_quartz" as user "ph_quartz_user" on host "127.0.0.1" at port "5432". Of course, 9.4 is very old version, but the same test at another env with PG12.3 succeeded (I could connect). I have checked various options for the connection string (as described in https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING), none worked. It looks like the password parameter is simply ignored. Also, I have checked the changes done to PG 12.5 - I found that 3 recent commits relate to the connect meta-command (src/bin/psql/command.c): https://github.com/postgres/postgres/commit/1b62d0fb3e50ede570d0d4e4a2be69d5645b48a7#diff-657963643e18c39703a2b162c0d1c002584c16289deff8614165544e4a4470c6 https://github.com/postgres/postgres/commit/94929f1cf6cb3ea070d0919d1303379b525a72a3#diff-657963643e18c39703a2b162c0d1c002584c16289deff8614165544e4a4470c6 https://github.com/postgres/postgres/commit/85c54287af56fe351b53913ea2b81e9d6145f964#diff-657963643e18c39703a2b162c0d1c002584c16289deff8614165544e4a4470c6 I cannot explain where is the issue but IMO the problem stems from these changes. Hope, you can help. BR -
Re: BUG #16746: [PG12.5 psql] Password ignored by connect meta-command
David G. Johnston <david.g.johnston@gmail.com> — 2020-11-29T00:48:32Z
Tom, will need your input here. On Thu, Nov 26, 2020 at 4:09 AM PG Bug reporting form < noreply@postgresql.org> wrote: > The following bug has been logged on the website: > > Bug reference: 16746 > Logged by: Krzysztof Gradek > Email address: kgradekx@gmail.com > PostgreSQL version: 12.5 > Operating system: Centos > Description: > > Hi > I just migrated my app to PG 12.5 and jumped into an issue which didn't > exist in PG12.3: the password provided in connection URI is ignored by > connect meta-command. > [...] > $ psql > psql (12.5) > Type "help" for help. > > postgres=# \connect > postgresql://ph_quartz_user:password@127.0.0.1/ph_quartz > Password for user ph_quartz_user: > > Same sequence using earlier version: > $ /usr/pgsql-9.4/bin/psql > psql (9.4.4, server 12.5) > WARNING: psql major version 9.4, server major version 12.0. > Some psql features might not work. > Type "help" for help. > > I checked versions 13.1 and 12.3 and can confirm that in v13 a password-included connection string still results in a prompt for a password when using \connect, but it does not in 12.3. David J.
-
Re: BUG #16746: [PG12.5 psql] Password ignored by connect meta-command
Tom Lane <tgl@sss.pgh.pa.us> — 2020-11-29T02:18:32Z
"David G. Johnston" <david.g.johnston@gmail.com> writes: > Tom, will need your input here. Ugh... looks like I broke this in 85c54287a et al. I had thought that this was the pre-existing behavior, but after further study I see that I was mistaken about how PQconnectdbParams() handles parameter replacement, so I misread what the prior code was really doing. regards, tom lane
-
Re: BUG #16746: [PG12.5 psql] Password ignored by connect meta-command
Tom Lane <tgl@sss.pgh.pa.us> — 2020-11-29T02:59:06Z
I wrote: > Ugh... looks like I broke this in 85c54287a et al. I had thought that > this was the pre-existing behavior, but after further study I see that > I was mistaken about how PQconnectdbParams() handles parameter > replacement, so I misread what the prior code was really doing. While I take full responsibility for having messed up here, I note that the documentation for PQconnectdbParams is seriously misleading on the point, in that it fails to point out that parameters appearing after "dbname" will only override the connstring if they supply non-empty values. Besides that, it's rather in need of copy-editing, not to mention some minimal thought about what is a reasonable order to make its points in. So I propose the attached docs fix to begin with. regards, tom lane