pg.ddx.io  pgsql-ports@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Treat <xzilla@users.sourceforge.net>
To: pgsql-ports@postgresql.org
To: pgsql-bugs@postgresql.org
Cc: Clark, Andrew <Andrew.Clark@fnf.com>
Subject: Re: [PORTS] Solaris - psql returns 0 instead of 1 for file not found.
Date: Thu, 22 Sep 2005 12:00:08 -0400
Message-ID: <200509221200.08227.xzilla@users.sourceforge.net> (raw)
In-Reply-To: <74825F195D477C4995425A1313D646B114A923@smbfisyyz01.FNFIS.COM>
References: <74825F195D477C4995425A1313D646B114A923@smbfisyyz01.FNFIS.COM>

On Monday 19 September 2005 14:01, Clark, Andrew wrote:
> Hi all,
>
> I've found the when psql is used with the -f flag and the specified file
> doesn't exist the rc value is 0.
>
> $ uname -a
> SunOS bld 5.8 Generic_108528-29 sun4u sparc SUNW,Sun-Fire-V440
>
> $ psql -V
> psql (PostgreSQL) 8.0.2
>
> $ ls foo
> foo: No such file or directory
>
> $ psql -f foo
> foo: No such file or directory
>
> $ echo $?
> 0
>
> However, in the man page for psql it says:
>
> EXIT STATUS
>      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, ...
>
> I'm assuming this is the same with other platforms, but I only use
> PostgreSQL on Solaris.
>
> Has this been fix in 8.0.3?
>

Redirecting to -bugs since I've confirmed this behavior on Slackware Linux 10 
with psql version 8.1beta1 and there does seem to be something wrong with the 
above situation  (perhaps the man page needs to be reworded?)

-- 
Robert Treat
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL



view thread (4+ messages)  latest in thread

Message-ID: <200509221200.08227.xzilla@users.sourceforge.net>
Permalink:  ../200509221200.08227.xzilla@users.sourceforge.net/
Also on:    postgresql.org/message-id/200509221200.08227.xzilla@users.sourceforge.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-ports@postgresql.org
  Cc: xzilla@users.sourceforge.net, pgsql-bugs@postgresql.org, Andrew.Clark@fnf.com
  Subject: Re: [PORTS] Solaris - psql returns 0 instead of 1 for file not found.
  In-Reply-To: <200509221200.08227.xzilla@users.sourceforge.net>
  References: <74825F195D477C4995425A1313D646B114A923@smbfisyyz01.FNFIS.COM> <200509221200.08227.xzilla@users.sourceforge.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox