public inbox for [email protected]  
help / color / mirror / Atom feed
pg_enc --input-file ability to read from stdin
5+ messages / 2 participants
[nested] [flat]

* pg_enc --input-file ability to read from stdin
@ 2026-02-17 16:36 zam bak <[email protected]>
  2026-02-19 00:39 ` Re: pg_enc --input-file ability to read from stdin Bo Peng <[email protected]>
  2026-02-19 02:21 ` Re: pg_enc --input-file ability to read from stdin Bo Peng <[email protected]>
  0 siblings, 2 replies; 5+ messages in thread

From: zam bak @ 2026-02-17 16:36 UTC (permalink / raw)
  To: [email protected]

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...





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pg_enc --input-file ability to read from stdin
  2026-02-17 16:36 pg_enc --input-file ability to read from stdin zam bak <[email protected]>
@ 2026-02-19 00:39 ` Bo Peng <[email protected]>
  2026-02-21 00:19   ` Re: pg_enc --input-file ability to read from stdin zam bak <[email protected]>
  1 sibling, 1 reply; 5+ messages in thread

From: Bo Peng @ 2026-02-19 00:39 UTC (permalink / raw)
  To: zam bak <[email protected]>; [email protected] <[email protected]>

Hi,

Could you try using "--input-file /dev/stdin"?

For example:
cat <<'EOF' | pg_enc --update-pass   --config-file etc/pgpool.conf   --input-file /dev/stdin
username1:secretpassword1
username2:secretpassword2
EOF

---
Bo Peng <[email protected]>
SRA OSS K.K.
URL: https://www.sraoss.co.jp/


________________________________________
差出人: zam bak <[email protected]>
送信: 2026 年 2 月 18 日 (水曜日) 1:36
宛先: [email protected] <[email protected]>
件名: 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...






^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pg_enc --input-file ability to read from stdin
  2026-02-17 16:36 pg_enc --input-file ability to read from stdin zam bak <[email protected]>
  2026-02-19 00:39 ` Re: pg_enc --input-file ability to read from stdin Bo Peng <[email protected]>
@ 2026-02-21 00:19   ` zam bak <[email protected]>
  0 siblings, 0 replies; 5+ messages in thread

From: zam bak @ 2026-02-21 00:19 UTC (permalink / raw)
  To: Bo Peng <[email protected]>; +Cc: [email protected] <[email protected]>

On Wed, Feb 18, 2026 at 7:39 PM Bo Peng <[email protected]> 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 <[email protected]>
> SRA OSS K.K.
> URL: https://www.sraoss.co.jp/
>
>
> ________________________________________
> 差出人: zam bak <[email protected]>
> 送信: 2026 年 2 月 18 日 (水曜日) 1:36
> 宛先: [email protected] <[email protected]>
> 件名: 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...
>
>
>
>





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pg_enc --input-file ability to read from stdin
  2026-02-17 16:36 pg_enc --input-file ability to read from stdin zam bak <[email protected]>
@ 2026-02-19 02:21 ` Bo Peng <[email protected]>
  2026-02-21 00:23   ` Re: pg_enc --input-file ability to read from stdin zam bak <[email protected]>
  1 sibling, 1 reply; 5+ messages in thread

From: Bo Peng @ 2026-02-19 02:21 UTC (permalink / raw)
  To: zam bak <[email protected]>; [email protected] <[email protected]>

hi,

> P.S.
> Documentation also does not mention if colon ':' needs to be escaped
> (and how) when password contains colon??

As far as I understand, a colon ':' in the password does not need to be escaped. 
Could you clarify what kind of case you are referring to?

________________________________________
差出人: zam bak <[email protected]>
送信: 2026 年 2 月 18 日 (水曜日) 1:36
宛先: [email protected] <[email protected]>
件名: 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...






^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pg_enc --input-file ability to read from stdin
  2026-02-17 16:36 pg_enc --input-file ability to read from stdin zam bak <[email protected]>
  2026-02-19 02:21 ` Re: pg_enc --input-file ability to read from stdin Bo Peng <[email protected]>
@ 2026-02-21 00:23   ` zam bak <[email protected]>
  0 siblings, 0 replies; 5+ messages in thread

From: zam bak @ 2026-02-21 00:23 UTC (permalink / raw)
  To: Bo Peng <[email protected]>; +Cc: [email protected] <[email protected]>

On Wed, Feb 18, 2026 at 9:21 PM Bo Peng <[email protected]> wrote:
>
> hi,
>
> > P.S.
> > Documentation also does not mention if colon ':' needs to be escaped
> > (and how) when password contains colon??
>
> As far as I understand, a colon ':' in the password does not need to be escaped.
> Could you clarify what kind of case you are referring to?

For the case where credentials are being read in from the file,
documentation states that the format should be

    username1:secretpassword1
    username2:secretpassword2


So I was wondering if the colon - if it is a part of the password has
to be escaped (because its also a separator between the username and
the password)
I did try this, for example:

    username1:secret:password1
    username2:secret:password2

...and it seems to work fine - is this expected? no escaping is needed?




>
> ________________________________________
> 差出人: zam bak <[email protected]>
> 送信: 2026 年 2 月 18 日 (水曜日) 1:36
> 宛先: [email protected] <[email protected]>
> 件名: 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...
>
>
>
>





^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2026-02-21 00:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-02-17 16:36 pg_enc --input-file ability to read from stdin zam bak <[email protected]>
2026-02-19 00:39 ` Bo Peng <[email protected]>
2026-02-21 00:19   ` zam bak <[email protected]>
2026-02-19 02:21 ` Bo Peng <[email protected]>
2026-02-21 00:23   ` zam bak <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox