log_line_prefix: make it possible to add the search_path

From: Pierre Ducroquet <p(dot)psql(at)pinaraf(dot)info>
To: pgsql-hackers(at)postgresql(dot)org
Subject: log_line_prefix: make it possible to add the search_path
Date: 2022-07-25 07:37:52
Message-ID: 3366542.QJadu78ljV@peanuts2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

I'm working on several databases where schemas are used to differentiate the
tenants.
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.
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 the real tables used in a query.
The attached patch implements this, using %S. I've not written the
documentation yet, since I'm not sure this would be acceptable as is, or if a
more "generic" method should be used (I thought of %{name} to fetch an
arbitrary GUC, but did not implement due to a lack of need for that feature)

Attachment Content-Type Size
0001-log_line_prefix-make-it-possible-to-add-search_path.patch text/x-patch 1.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Japin Li 2022-07-25 07:54:07 Typo in misc_sanity.sql?
Previous Message Martin Kalcher 2022-07-25 07:34:31 Re: [PATCH] Introduce array_shuffle() and array_sample()