Home > Software engineering >  Get session number from namespace USERENV in postgresql
Get session number from namespace USERENV in postgresql

Time:07-19

While migrating oracle to postgresql I came up with the query:

Oracle:

select SYS_CONTEXT('USERENV','SID') from dual;

What will be the equivalent in PostgreSQL?

CodePudding user response:

The only thing I can think of is the backend PID

select pg_backend_pid();
  • Related