pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: magodo <wztdyl@sina.com>
To: Postgres general <pgsql-general@postgresql.org>
Subject: psql dones't reflect exit status if input command via stdin
Date: Tue, 14 May 2019 14:24:20 +0800
Message-ID: <ee57f43d501e57e7dfa70be17b6345ae2e9ffdcb.camel@sina.com> (raw)


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







view thread (3+ messages)  latest in thread

Message-ID: <ee57f43d501e57e7dfa70be17b6345ae2e9ffdcb.camel@sina.com>
Permalink:  ../ee57f43d501e57e7dfa70be17b6345ae2e9ffdcb.camel@sina.com/
Also on:    postgresql.org/message-id/ee57f43d501e57e7dfa70be17b6345ae2e9ffdcb.camel@sina.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: wztdyl@sina.com
  Subject: Re: psql dones't reflect exit status if input command via stdin
  In-Reply-To: <ee57f43d501e57e7dfa70be17b6345ae2e9ffdcb.camel@sina.com>
  References: <ee57f43d501e57e7dfa70be17b6345ae2e9ffdcb.camel@sina.com>

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

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