I'm looking for some concrete information about how connections and connection pooling in Npgsql translates to PostgreSQL's idea of a 'session'. Specifically:
- Is an
NpgsqlConnection.Open
synonymous with creating a new session? - Assuming the above is true, is that also ALWAYS true when connection pooling is enabled and a connection is reused?
- Is there any risk of session-based configurations (
set_config
/current_setting
) 'leaking' between pooled connections?
For context, I want to use session-based settings to enforce multi-tenancy RLS policies, but I want to rule out the possibility of connection pooling causing leaks in corner cases.
Thanks.