Re: psql \watch always ignores \pset null
От | Will Leinweber |
---|---|
Тема | Re: psql \watch always ignores \pset null |
Дата | |
Msg-id | CAL8LqZSi-eKzO5W9GOtY1kw89Zwt2T7GOWTB2ZFF5CK8wM0t4A@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: psql \watch always ignores \pset null (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: psql \watch always ignores \pset null
|
Список | pgsql-hackers |
On Tue, Nov 18, 2014 at 9:54 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > > Fujii Masao <masao.fujii@gmail.com> writes: > > Hi, > >> /* > >> * Set up rendering options, in particular, disable the pager, because > >> * nobody wants to be prompted while watching the output of 'watch'. > >> */ > >> myopt.nullPrint = NULL; > >> myopt.topt.pager = 0; > > > I found psql's \watch command always ignores \pset null setting. > > The above source code comment explains why it does, > > but I'd like to see the specified string for null value even in \watch's > > output, in order to distinguish null and an empty value. Thought? > > Is there any reason why \watch must ignore \pset null setting? > > Hmmm ... the comment offers a reasonable argument for forcing pager = 0, > but I agree the nullPrint change is not adequately explained. > Will, do you remember why you did that? > > regards, tom lane I tracked down the individual commit[1] from my history where I added that. What I added there is very similar to sections in src/bin/psql/describe.c. I can't remember specifically my reasoning then, but it's likely I copied the patterns there while getting things working. I do still think it's important to remove the pager, but the nullPrint is probably a mistake. [1]: https://github.com/will/postgres/commit/c42d29fece16ec9cb13c159b3307ab9fca892eb2
В списке pgsql-hackers по дате отправления: