Re: pg_enc --input-file ability to read from stdin

From: zam bak <zam6ak(at)gmail(dot)com>
To: Bo Peng <pengbo(at)sraoss(dot)co(dot)jp>
Cc: "pgpool-general(at)lists(dot)postgresql(dot)org" <pgpool-general(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_enc --input-file ability to read from stdin
Date: 2026-02-21 00:19:42
Message-ID: CAEy4EGXTkOpcMx=i_btu7DxL1mAUaY_pnY9h+o6+axq0yi58UQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgpool-general

On Wed, Feb 18, 2026 at 7:39 PM Bo Peng <pengbo(at)sraoss(dot)co(dot)jp> wrote:
>
> Hi,
>
> Could you try using "--input-file /dev/stdin"?

I can confirm that this works!
Thank you!

>
> For example:
> cat <<'EOF' | pg_enc --update-pass --config-file etc/pgpool.conf --input-file /dev/stdin
> username1:secretpassword1
> username2:secretpassword2
> EOF
>
> ---
> Bo Peng <pengbo(at)sraoss(dot)co(dot)jp>
> SRA OSS K.K.
> URL: https://www.sraoss.co.jp/
>
>
> ________________________________________
> 差出人: zam bak <zam6ak(at)gmail(dot)com>
> 送信: 2026 年 2 月 18 日 (水曜日) 1:36
> 宛先: pgpool-general(at)lists(dot)postgresql(dot)org <pgpool-general(at)lists(dot)postgresql(dot)org>
> 件名: pg_enc --input-file ability to read from stdin
>
>
> Hello
>
> Is it possible to pipe stdin output to pg_end --input-file option by
> using dash '-' as a placeholder for stdin?
> https://www.pgpool.net/docs/latest/en/html/pg-enc.html
>
> I tried both "echo" and "cat" and am not able to do it.
>
> Example 1:
> cat <<'EOF' | pg_enc --update-pass --key-file
> /etc/pgpool-II/.pgpoolkey --config-file /etc/pgpool-II/pgpool.conf
> --input-file -
> username1:secretpassword1
> username2:secretpassword2
> EOF
> trying to read key from file /etc/pgpool-II/.pgpoolkey
> trying to read username:password pairs from file -
> failed to open input_file "-" (No such file or directory)
>
> Example 2:
> echo '
> username1:secretpassword1
> username2:secretpassword2
> ' | pg_enc --update-pass --key-file /etc/pgpool-II/.pgpoolkey
> --config-file /etc/pgpool-II/pgpool.conf --input-file -
> trying to read key from file /etc/pgpool-II/.pgpoolkey
> trying to read username:password pairs from file -
> failed to open input_file "-" (No such file or directory)
>
>
> The reason for asking about this is:
> * to be able to use pg_enc in scripting setups
> * to be able to provide list of usernames/passwords without having to
> actually create a file
> * to be able to reduce escaping when autogenerated passwords contain
> special characters (by echoing literals)
>
>
> P.S.
> Documentation also does not mention if colon ':' needs to be escaped
> (and how) when password contains colon??
>
>
>
> Thanks
> Z...
>
>
>
>

In response to

Browse pgpool-general by date

  From Date Subject
Next Message zam bak 2026-02-21 00:23:32 Re: pg_enc --input-file ability to read from stdin
Previous Message Bo Peng 2026-02-19 02:21:34 Re: pg_enc --input-file ability to read from stdin