psql return codes

From: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: psql return codes
Date: 2006-12-05 12:14:57
Message-ID: 1165320898.3839.152.camel@silverbirch.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Currently, if we issue this command

psql --set ON_ERROR_STOP= -f f.sql

where f.sql has "select * from foo;"
then psql will return
0 if foo exists
3 if foo does not exist (or other SQL error)

Whereas
psql --set ON_ERROR_STOP= -c "select * from foo;"
returns
0 if foo exists
1 if foo does not exist (or other SQL error)

Is this a minor oversight, or some aspect of design?

--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zdenek Kotala 2006-12-05 12:55:48 Re: Order of checking for readline support libraries
Previous Message Teodor Sigaev 2006-12-05 12:13:16 Re: Bundle of patches