Re: psql - factor out echo code

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: psql - factor out echo code
Дата
Msg-id CAFj8pRAhNvEfU0nnKTWa1qdYfdG_tEyBnOE4=4t0R6HR_rKjQQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: psql - factor out echo code  (Fabien COELHO <coelho@cri.ensmp.fr>)
Ответы Re: psql - factor out echo code  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
Hi


ne 24. 7. 2022 v 21:39 odesílatel Fabien COELHO <coelho@cri.ensmp.fr> napsal:

>> Attached v4 simplifies the format and fixes this one.
>
> I think this goes way way overboard in terms of invasiveness. There's no
> need to identify individual call sites of PSQLexec. [...]

ISTM that having the information was useful for the user who actually
asked for psql to show hidden queries, and pretty simple to get, although
somehow invasive.

> It also looks like a mess from the translatibility standpoint.
> You can't expect "%s QUERY" to be a useful thing for translators.

Sure. Maybe I should have used an enum have a explicit switch in
echoQuery, but I do not like writing this kind of code.

Attached a v5 without hinting at the origin of the query beyond internal
or not.


I had just one question - with this patch, the format of output of modes ECHO ALL and ECHO QUERIES will be different, and that can be a little bit messy. On second hand, the prefix --QUERY can be disturbing in echo queries mode. It is not a problem in echo all mode, because queries and results are mixed together. So in the end, I think the current design can work.

All tests passed, this is trivial patch without impacts on users

I'll mark this patch as ready for committer

Regards

Pavel


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: Re: [PATCH] Introduce array_shuffle() and array_sample()
Следующее
От: Justin Pryzby
Дата:
Сообщение: 012_subtransactions.pl vs clang -fsanitize=undefined