2

It is possible in Oracle to examine the session-level settings for sessions other than your own (subject to privs obv). Is there an equivalent method in Postgres 9 or 10?

1

I don't think it's possible. PostreSQL session variables are meant for mostly scripts to run in the same session. If you need persisting variables across user, or a place to store state -- PostgreSQL can do that too, just use a table.

From there you can limit access to the table through Pg access permissions or getter-setter functions.

Here is an example of such a scheme, https://www.depesz.com/2009/08/20/getting-session-variables-without-touching-postgresql-conf/

  • It's not about sharing variables so much as it is diagnosing an unexpected behaviour without interrupting a running process, that what we used this feature for in my Oracle days anyway – Gaius Oct 22 '17 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.