Re: BUG #5333: psql returns 0 on error

From: Alex Hunsaker <badalex(at)gmail(dot)com>
To: pekka(dot)jarvinen(at)gmail(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5333: psql returns 0 on error
Date: 2010-02-18 18:11:42
Message-ID: 34d269d41002181011m429dc14bo52dc88aa86a31223@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Feb 18, 2010 at 02:20, <pekka(dot)jarvinen(at)gmail(dot)com> wrote:
> $ psql -U foo -h 127.0.0.1 -f doesntwork.sql db
> Password for user foo:
> ERROR:  invalid byte sequence for encoding "UTF8": 0xe46976
> HINT:  This error can also happen if the byte sequence does not match the
> encoding expected by the server, which is controlled by "client_encoding".

> $ echo $?
> 0

You probably want to define ON_ERROR_STOP... see the man page about it.

psql -v 'ON_ERROR_STOP=on' ...

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alex Hunsaker 2010-02-18 18:32:38 Re: BUG #5334: Version 2.22 of Perl Safe module breaks UTF8 PostgreSQL 8.4
Previous Message Tim Bunce 2010-02-18 18:09:00 Re: BUG #5334: Version 2.22 of Perl Safe module breaks UTF8 PostgreSQL 8.4