psql ignores failure to open -o target file

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: psql ignores failure to open -o target file
Date: 2015-12-02 16:07:58
Message-ID: 26258.1449072478@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I just noticed that parse_psql_options() ignores the result of setQFout(),
meaning that if the argument of a -o command line option is bogus, we'll
ignore the switch entirely after printing an error report. For example

$ psql -o /dev/foo -c 'select 1'
/dev/foo: Permission denied
?column?
----------
1
(1 row)

$

This seems surprising to me: any other program in the world would do
exit(1) after discovering that it couldn't write where it had been
told to. Should we change this?

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2015-12-02 16:25:13 Re: Remaining 9.5 open items
Previous Message Andres Freund 2015-12-02 15:46:26 Re: Rework the way multixact truncations work