Setting a session variable for a Postgres connection

Answered

Is it possible to issue the equivalent of either 

SELECT set_config('app.current_tenant', '100', false); or

SET app.current_tenant = '100';

So that the value of app.current_tenant can be used for Row Level Security (RS)

Thanks !

 

 

 

2 comments
Comment actions Permalink

Yes you can do it in Data Source properties -> Options tab -> Startup script. Just put

SET app.current_tenant = '100'

there and restart session.

0
Comment actions Permalink

That worked, thank you

0

Please sign in to leave a comment.