On Wed, Jan 4, 2023 at 5:00 PM PG Bug reporting form <
noreply@postgresql.org> wrote:
> Because $ is escaped, the results are different when the same command is
> executed in psql and internally.
> I would like to ask how to solve this problem, or why there is this
> difference?
When passing a quoted argument to psql, it is necessary to account for the shell's interpretation, for example:
$ echo "foo $1"
foo
$ echo "foo \$1"
foo $1