public inbox for [email protected]  
help / color / mirror / Atom feed
From: zam bak <[email protected]>
To: [email protected]
Subject: pg_enc --input-file ability to read from stdin
Date: Tue, 17 Feb 2026 11:36:58 -0500
Message-ID: <CAEy4EGV7+UEkDmn4CmO3hcTXnbZYXqkk5tXqDYORs8oPAyqFGw@mail.gmail.com> (raw)

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





reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pg_enc --input-file ability to read from stdin
  In-Reply-To: <CAEy4EGV7+UEkDmn4CmO3hcTXnbZYXqkk5tXqDYORs8oPAyqFGw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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