Fix pg_enc not working if both -p and -P are provided.
authorTatsuo Ishii <ishii@postgresql.org>
Wed, 24 Sep 2025 01:26:14 +0000 (10:26 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Wed, 24 Sep 2025 01:26:14 +0000 (10:26 +0900)
commit6635270c93d80fd4b3d904242116379a4c8e4007
tree483fe0945759d6bf8630068a2f8b2802b66e3a31
parent8ec8e352a38e79815c9d7d31fef4184494796c01
Fix pg_enc not working if both -p and -P are provided.

In the original report (https://github.com/pgpool/pgpool2/issues/129:

[root@test1 bin]# ./pg_enc -p -P
db password:
encryption key:
encryption key not provided

Also I found a misleading comment:
case 'p': /* prompt for postgres password */

This is not appropriate since the password is not provided to
PostgreSQL. It is totally unrelated to the issue but I replaced it
with following in this opportunity:

case 'p': /* prompt for password to be encrypted */

Author: jinyang liu <liujy@highgo.com>
Discussion: https://www.postgresql.org/message-id/7f18c30b.237.1997555ca11.Coremail.liujy%40highgo.com
Backpatch-through: v4.2
src/tools/pgenc/pg_enc.c