psql dones't reflect exit status if input command via stdin

From: magodo <wztdyl(at)sina(dot)com>
To: Postgres general <pgsql-general(at)postgresql(dot)org>
Subject: psql dones't reflect exit status if input command via stdin
Date: 2019-05-14 06:24:20
Message-ID: ee57f43d501e57e7dfa70be17b6345ae2e9ffdcb.camel@sina.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Hello,

I found when running command like `# echo "xxx" | psql postgres
postgres`, the return code is always 0 even though the command ("xxx")
here is of invalid syntax. While the `psql -c` way handled exit code
correctly.

In the meanwhile, mysql client handled both cases correctly.

---
Zhaoting.Weng

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2019-05-14 06:39:58 Re: psql dones't reflect exit status if input command via stdin
Previous Message Adrian Klaver 2019-05-14 01:16:45 Re: does postgresql backup require additional space on disk