Re: log_line_prefix: make it possible to add the search_path

2022-07-26 Thread Pierre
On Tuesday, July 26, 2022 3:08:01 AM CEST Lukas Fittl wrote: > On Mon, Jul 25, 2022 at 12:38 AM Pierre Ducroquet > > wrote: > > usecase by not showing the schema, one of them being log_line_prefix. > > It is possible to work around this using the application_name, but a > > mistake > > on the

Re: log_line_prefix: make it possible to add the search_path

2022-07-25 Thread Lukas Fittl
On Mon, Jul 25, 2022 at 12:38 AM Pierre Ducroquet wrote: > usecase by not showing the schema, one of them being log_line_prefix. > It is possible to work around this using the application_name, but a > mistake > on the application side would be fatal, while the search_path would still > indicate

Re: log_line_prefix: make it possible to add the search_path

2022-07-25 Thread Tom Lane
Alvaro Herrera writes: > Maybe your idea of allowing arbitrary GUCs is not a bad one, something > like > %{search_path}G > (where we add a letter at the end just so we can add other things in the > future that aren't GUCs.) I'm pretty uncomfortable about the amount of code that could

Re: log_line_prefix: make it possible to add the search_path

2022-07-25 Thread Alvaro Herrera
On 2022-Jul-25, Pierre wrote: > On Monday, July 25, 2022 11:52:41 AM CEST Alvaro Herrera wrote: > > It seems that this would be too noisy to be truly usable. What if we > > emitted a log line when the variable changed, and the value that's in > > use when the connection starts? > > Then the

Re: log_line_prefix: make it possible to add the search_path

2022-07-25 Thread Pierre
On Monday, July 25, 2022 11:52:41 AM CEST Alvaro Herrera wrote: > On 2022-Jul-25, Pierre Ducroquet wrote: > > This is great for performance, but several tools are lacking around this > > usecase by not showing the schema, one of them being log_line_prefix. > > > > The attached patch implements

Re: log_line_prefix: make it possible to add the search_path

2022-07-25 Thread Alvaro Herrera
On 2022-Jul-25, Pierre Ducroquet wrote: > This is great for performance, but several tools are lacking around this > usecase by not showing the schema, one of them being log_line_prefix. > The attached patch implements this, using %S. I've not written the > documentation yet, since I'm not

log_line_prefix: make it possible to add the search_path

2022-07-25 Thread Pierre Ducroquet
g_line_prefix: make it possible to add search_path This adds support for %S to add the current search_path in log_line_prefix, thus making it easier to track slow queries on databases with for instance one schema per tenant. --- src/backend/utils/error/elog.c | 8 +++- 1 file changed, 7 ins