vsql exit status for "No such file or directory"
Please add non zero exit status for vsql if specified file is not exists
$ vsql -f nonexisting.sql && echo OK || echo FAIL nonexisting.sql: No such file or directory OK
Same problem with included files
$ vsql -a -f error.sql && echo OK || echo FAIL
\set ON_ERROR_STOP on
\i nonexisting.sql
vsql:error.sql:2: nonexisting.sql: No such file or directory
select 2;
?column?
----------
2
(1 row)
OK
vsql continues execution without stopping
0
Answers
Maybe check if the file exists prior to running vsql?
Example:
[dbadmin@localhost ~]$ FILE=/home/dbadmin/run_me.sql [dbadmin@localhost ~]$ ll $FILE ls: cannot access '/home/dbadmin/run_me.sql': No such file or directory [dbadmin@localhost ~]$ [ -f $FILE ] && vsql -f $FILE || echo "$FILE does not exist." /home/dbadmin/run_me.sql does not exist. [dbadmin@localhost ~]$ echo "SELECT 1 AS some_column;" > $FILE [dbadmin@localhost ~]$ [ -f $FILE ] && vsql -f $FILE || echo "$FILE does not exist." some_column ------------- 1 (1 row)Process must return correct exit code. All programs do that.
Sorry for some toxic in my opinion )
I like your product. You made a lot of cool things in Vertica DB.
Thanks for support and continuous development!