Access session level local params from another transaction by process id (PID)

From: Stanislav Mudrinski <stanislav(dot)mudrinski(at)navigator(dot)rs>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Access session level local params from another transaction by process id (PID)
Date: 2020-12-22 00:38:29
Message-ID: f446598e-99e6-e0e4-0d66-f129200a06b5@navigator.rs
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have a question regarding session params. We are using them thru SET
LOCAL call request when connection is popped from pool to set, for
example userId or API call route for current transaction so that any
stored procedure can fetch them, if needed.

This reduces number of params for every stored procedure call.

In order to debug system locks, we want to access those values. I have
found an idea  on https://wiki.postgresql.org/wiki/Lock_Monitoring to use

SET application_name='%application_name_plus_additional_params%'

to be able to acces those data when we have system locks, but that adds
anotner call on every transaction.
Is it somehow possible to access session level configuration data for
specific PID from another transaction?

Kind regards,

Stanislav

Browse pgsql-general by date

  From Date Subject
Next Message Gustavsson Mikael 2020-12-22 08:07:17 SV: SV: SV: SV: Problem with ssl and psql in Postgresql 13
Previous Message Adrian Klaver 2020-12-21 22:51:44 Re: Missing rows after migrating from postgres 11 to 12 with logical replication