Corey Huinker <corey.huinker@gmail.com> writes:
> This is a follow up patch to apply the committed pattern to the various
> piped output commands.
Pushed with some changes:
* You didn't update the documentation.
* I thought this was way too many copies of the same logic. I made a
subroutine to set these variables, and changed the original uses too.
* You didn't change \w (exec_command_write) to set these variables.
I'm assuming that was an oversight; if it was intentional, please
explain why.
I looked through psql's other uses of pclose() and system(),
and found:
* pager invocations
* backtick evaluation within a prompt
* \e (edit query buffer)
I think that not changing these variables in those places is a good
idea. For instance, if prompt display could change them then they'd
never survive long enough to be useful; plus, having the behavior
vary depending on your prompt settings seems pretty horrid.
In general, these things are mainly useful to scripts, and I doubt
that we want their interactive behavior to vary from scripted behavior,
so setting them during interactive-only operations seems bad.
regards, tom lane