Cannot Dynamically Set PostGres Schema at Runtime
Issue #4081
closed
The Library is unable to Dynamically Set PostGres Schema at Runtime.
This is pretty basic functionality.
Comments (2)
-
repo owner -
repo owner - changed status to closed
recipe provided
- Log in to comment
Postgresql doesn't have a "schema" that is set, it has a "schema search path" (https://www.postgresql.org/docs/current/static/ddl-schemas.html#DDL-SCHEMAS-PATH). this is a postgresql-specific concept so requires that you use the Postgresql commands directly.
to achieve this for all new connections immediately, use a connect event:
to achieve it for an arbitrary connection from the engine:
keep in mind if you are using a connection pool, that search path doesn't get automatically reset.