HI all, I have a fairly complex python script which calls a number of ‘psql’ sessions via a subprocess to perform bulk load operations. The bulk loads are generated on the fly, and are written directly to the stdin of the subprocess. I would like to rely on the _ON_ERROR_STOP_=1 functionality to force the process to exit with an error code – however, psql rightly believes the process it is operating under is an interactive one – since it is receiving its input from stdin. For performance (and disk) reasons, I’d rather not have to rely on writing my input to a file, before passing it to psql with –f This part of the man page gave me hope…
Eg: psql –v _ON_ERROR_STOP_=1 –f - But it seems this is still understood by psql to be an interactive session, and fails to exit the process on an error. Is there any way to force psql to read from stdin, in a non-interactive manner? (that is, to ensure it exits the process on an error condition?) Thanks for any advice Tim |