X-Original-To: pgsql-bugs-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B44B1DA951; Thu, 22 Sep 2005 13:00:24 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 08509-04; Thu, 22 Sep 2005 16:00:22 +0000 (GMT) Received: from eastrmmtao05.cox.net (eastrmmtao05.cox.net [68.230.240.34]) by svr1.postgresql.org (Postfix) with ESMTP id 08544DA946; Thu, 22 Sep 2005 13:00:19 -0300 (ADT) Received: from [192.168.0.17] (really [68.105.164.251]) by eastrmmtao05.cox.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20050922160009.VPRH24048.eastrmmtao05.cox.net@[192.168.0.17]>; Thu, 22 Sep 2005 12:00:09 -0400 From: Robert Treat Reply-To: pgsql-bugs@postgresql.org To: pgsql-ports@postgresql.org, pgsql-bugs@postgresql.org Subject: Re: [PORTS] Solaris - psql returns 0 instead of 1 for file not found. Date: Thu, 22 Sep 2005 12:00:08 -0400 User-Agent: KMail/1.6.2 Cc: "Clark, Andrew" References: <74825F195D477C4995425A1313D646B114A923@smbfisyyz01.FNFIS.COM> In-Reply-To: <74825F195D477C4995425A1313D646B114A923@smbfisyyz01.FNFIS.COM> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200509221200.08227.xzilla@users.sourceforge.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.039 required=5 tests=[AWL=0.039] X-Spam-Level: X-Archive-Number: 200509/148 X-Sequence-Number: 12888 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