Skip to content

Fix(duckdb): Use CREATE OR REPLACE when registering secrets on cursor init to prevent an 'already exists' error #4974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 16, 2025

Conversation

erindru
Copy link
Collaborator

@erindru erindru commented Jul 16, 2025

Prior to this PR, if you were using DuckDB secrets and more than 1 connection, you'd get the following error on subsequent connections:

Temporary secret with name 's3' already exists!

This PR creates secrets using CREATE OR REPLACE instead of just CREATE to prevent this.

Note that we don't use CREATE IF NOT EXISTS because we want updated credentials to replace existing credentials rather than continuing to use old credentials.

@erindru erindru force-pushed the erin/duckdb-secrets branch from 46de374 to 2e87eaf Compare July 16, 2025 02:06
@erindru erindru merged commit e2a406f into main Jul 16, 2025
27 checks passed
@erindru erindru deleted the erin/duckdb-secrets branch July 16, 2025 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants