Re: psql exit code, bug ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: psql exit code, bug ?
Date: 2009-09-16 14:31:50
Message-ID: 4367.1253111510@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?UTF-8?Q?Grzegorz_Ja=C5=9Bkiewicz?= <gryzman(at)gmail(dot)com> writes:
> Looks like psql loves to report on errors, only when -c is used,
> otherwise return code is always 0...

The documentation seems perfectly clear on this point:

psql returns 0 to the shell if it finished normally, 1 if a fatal error of its own (out of memory, file not found) occurs, 2 if the connection to the server went bad and the session was not interactive, and 3 if an error occurred in a script and the variable ON_ERROR_STOP was set.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Grzegorz Jaśkiewicz 2009-09-16 14:35:36 Re: psql exit code, bug ?
Previous Message Grzegorz Jaśkiewicz 2009-09-16 14:05:18 psql exit code, bug ?