Re: Add SHELL_EXIT_CODE to psql
От | Tom Lane |
---|---|
Тема | Re: Add SHELL_EXIT_CODE to psql |
Дата | |
Msg-id | 2800511.1680817289@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Add SHELL_EXIT_CODE to psql (Corey Huinker <corey.huinker@gmail.com>) |
Список | pgsql-hackers |
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
В списке pgsql-hackers по дате отправления: