dbt 1.5.2, Postgres
I’m alternating between two schemas and in the final step of my process have to change the user’s search_path.
It works fine in plain SQL:
ALTER USER ci_api SET search_path TO ci_f,public;
SELECT rolconfig FROM pg_roles WHERE rolname=‘ci_api’;
My macro does exactly the same:
{% macro sp1() %}
{% set sql %}ALTER USER ci_api SET search_path TO ci_x,public{% endset %}
run_query(sql);
{% do log(run_query(“SELECT rolconfig FROM pg_roles WHERE rolname=‘ci_api’”).columns[0].values()[0], info=True) %}
{% endmacro %}
But does nothing. No errors, the log looks normal, but search_path doesn’t change.
What am I missing?