Hi everyone,
I would like to try using RLS
provided by Postgres
.
To do so, i need to understand if there is any documentation—please kindly point it out—and how the lifecycle of a database connection works.
In the section dedicated to database connections, within the
connection initialization
there is the section
connection initialization commands
with the comment:
a set of commands (one per line) that will be executed each time a connection is pulled from the pool. can be used to reset environment variables.
I am interested in understanding how and when a connection is requested/managed by the gateway, whether this connection is shared among all resources using it or if its lifecycle is limited to a single project or session.
Since what i would like to implement is a multi tenant management system using rls and not relying solely on query control,
is there a way to dynamically pass parameters during the initialization of a database connection and ensure that this session is valid only for a single vision/perspecive session, or even better, that a single connection is requested per query?
Thanks in advance.