You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pg_repack hangs when entering an empty or blank string at the password prompt of pg_repack.
It does not return until interrupt with Ctrl+C.
Also, during this, pg_repack is continuously trying to connect to the database.
This causes outputting a large amount of connection log if log_connections=on was specified in the database.
I found this problem in PostgreSQL 14.1 and pg_repack 1.4.7.
[Reproduce procedure]
Create a password authenticated user on the database.
Run pg_repack specifing 1.'s user. (Do not specify -w option)
When the password prompt appears, press Enter without entering anything or with entering only blank.
According to my research, this problem seems to start from #184.
In pgut_connect()'s connection loop, if PQconnectionNeedsPassword(conn) is true,
the password prompt is appeared by prompt_for_password() and it requires input of password.
prompt_for_password() remembers the password.
In pgut_connect(), the password obtained from prompt_for_password() is appended to the connection string as "password=%s" format.
Then, the connection string will end with "password=" because the entered password was empty string.
On the other hand, PostgreSQL Server seems to request the password again if the connection string ends with "password=".
Therefore, PQconnectionNeedsPassword(conn) is still true during reconnect loop of pgut_connect(), and it causes infinite loop.
The text was updated successfully, but these errors were encountered:
pg_repack hangs when entering an empty or blank string at the password prompt of pg_repack.
It does not return until interrupt with Ctrl+C.
Also, during this, pg_repack is continuously trying to connect to the database.
This causes outputting a large amount of connection log if log_connections=on was specified in the database.
I found this problem in PostgreSQL 14.1 and pg_repack 1.4.7.
[Reproduce procedure]
According to my research, this problem seems to start from #184.
In pgut_connect()'s connection loop, if PQconnectionNeedsPassword(conn) is true,
the password prompt is appeared by prompt_for_password() and it requires input of password.
prompt_for_password() remembers the password.
In pgut_connect(), the password obtained from prompt_for_password() is appended to the connection string as "password=%s" format.
Then, the connection string will end with "password=" because the entered password was empty string.
On the other hand, PostgreSQL Server seems to request the password again if the connection string ends with "password=".
Therefore, PQconnectionNeedsPassword(conn) is still true during reconnect loop of pgut_connect(), and it causes infinite loop.
The text was updated successfully, but these errors were encountered: