Tim Kane wrote:
> I’ve enabled shell debugging to be 100% sure that I’m not munging the return code anywhere. It’s
> entirely possible there is something going on at the shell side of things, though I fail to see how
> just at the minute :)
> The output of the script is as follows, bearing in mind that all STDERR is being redirected to STDOUT
> – there should be no other output to be found.
> I’ve verified stdout just in case, to no avail.
>
[...]
> COMMIT;
> COMMIT
> Time: 0.242 ms
Doesn't look like that could cause return code 1 ...
Just a random idea: are there any weird characters at
the end of your SQL script?
But that wouldn't explain why psql sometimes emits
return code 1 and sometimes not ...
Yours,
Laurenz Albe