Re: [GENERAL] psql exit code, bug ?

2009-09-16 Thread Grzegorz Jaśkiewicz
2009/9/16 Tom Lane : > =?UTF-8?Q?Grzegorz_Ja=C5=9Bkiewicz?= 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

Re: [GENERAL] psql exit code, bug ?

2009-09-16 Thread Tom Lane
=?UTF-8?Q?Grzegorz_Ja=C5=9Bkiewicz?= 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 o

[GENERAL] psql exit code, bug ?

2009-09-16 Thread Grzegorz Jaśkiewicz
http://gj.pastebin.com/f119e67bc Looks like psql loves to report on errors, only when -c is used, otherwise return code is always 0... I tested 8.3 and cvs-head, both have the same issue. Is that the 'by design' (bug/feature) ? -- GJ -- Sent via pgsql-general mailing list (pgsql-general@pos

Re: [GENERAL] psql exit code

2008-11-10 Thread Ivan Sergio Borgonovo
On Mon, 10 Nov 2008 10:56:57 + Richard Huxton <[EMAIL PROTECTED]> wrote: > Ivan Sergio Borgonovo wrote: > > I'm running: > > > > ON_ERROR_STOP="on" PGPASSFILE="/somewhere" psql dbname username > > -f script.sql > > (or alternatively > > > echo $? > > always returns 0 even when sql is clearl

Re: [GENERAL] psql exit code

2008-11-10 Thread Richard Huxton
Ivan Sergio Borgonovo wrote: > I'm running: > > ON_ERROR_STOP="on" PGPASSFILE="/somewhere" psql dbname username -f > script.sql > (or alternatively > 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 p

[GENERAL] psql exit code

2008-11-10 Thread Ivan Sergio Borgonovo
I'm running: ON_ERROR_STOP="on" PGPASSFILE="/somewhere" psql dbname username -f script.sql (or alternatively http://www.webthatworks.it -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general