Drew Wilson wrote:
> Is there anyway to test for errors returned by psql?
>
> For example:
> echo "select foo from pg_database" | psql -U admin myDB || echo
> "failed" && echo "success"
>
> This doesn't work. Neither "failed" nor "success" are echoed.
> Only 'ERROR: Attribute "foo" not found' is displayed on console.
Try:
psql -c "select foo from pg_database" -U admin myDB && echo "success" ||
echo "failed"
--
Peter Gibbs
EmKel Systems