-
-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
First off thank you for creating an awesome tool for interacting with aurora databases!
Problem
Setting the current user's search path with an aurora data API connection and cursor instance doesn't persist within a separate downstream connection and cursor instance.
The following snippet show this problem:
import aurora_data_api
with aurora_data_api.connect(
aurora_cluster_arn=cluster_arn,
secret_arn=secret_arn,
database=db,
continue_after_timeout=True,
) as conn:
with conn.cursor() as cur:
cur.execute("ALTER ROLE CURRENT_USER SET search_path to bar")
with aurora_data_api.connect(
aurora_cluster_arn=cluster_arn,
secret_arn=secret_arn,
database=db
) as conn:
with conn.cursor() as cur:
cur.execute("show search_path")
print(cur.fetchone())
The print statement outputs the default search path and not the expected bar search path.
The RDS cluster is using a serverless Aurora PostgreSQL engine.
Attempts
- I thought the problem may be a race condition where the
show search_pathstatement is run before theALTER ROLE CURRENT_USER SET search_path to barstatement is applied to the database. To check this, I successfully ran the ALTER ROLE statement, waited ~30 minutes, and ran the subsequent show search path statement. The search path is still not the expected value.
Metadata
Metadata
Assignees
Labels
No labels