Re: psql exit code

Поиск
Список
Период
Сортировка
От Ivan Sergio Borgonovo
Тема Re: psql exit code
Дата
Msg-id 20081110121551.0d44fdd3@dawn.webthatworks.it
обсуждение исходный текст
Ответ на Re: psql exit code  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
On Mon, 10 Nov 2008 10:56:57 +0000
Richard Huxton <dev@archonet.com> wrote:

> Ivan Sergio Borgonovo wrote:
> > I'm running:
> >
> > ON_ERROR_STOP="on" PGPASSFILE="/somewhere" psql dbname username
> > -f script.sql
> > (or alternatively <script.sql)
> >
> > echo $?
> > always returns 0 even when sql is clearly wrong.
>
> I don't think ON_ERROR_STOP is read from the environment, you need
> to define it as a psql variable.
>
> psql -v 'ON_ERROR_STOP=on' ...
>
> That should give you an error code.

Thanks. You're right.

--
Ivan Sergio Borgonovo
http://www.webthatworks.it


В списке pgsql-general по дате отправления:

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: psql exit code
Следующее
От: Sam Mason
Дата:
Сообщение: Re: Fulltext index