0

In SQL Server, there is a built-in function CONTEXT_INFO() to read the value of CONTEXT_INFO variable.

SET CONTEXT_INFO 0; // set
SELECT CONTEXT_INFO(); // Get

I want to do the same thing for PostgreSQL with Session scope. How can I do SET and GET with session scope ?

I even tried to refer What's the PostgreSQL equivalent of MSSQL's CONTEXT_INFO? and hence https://postgres.cz/wiki/PostgreSQL_SQL_Tricks_II#Any_other_session_variables but still couldn't make it work. Do I need to configure something to make this work ?

Pratik
  • 908
  • 2
  • 11
  • 34

0 Answers0