fix: qualify catalog names with schema names in get_schema_names #740
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Due to having multiple databases in DuckDB, the Postgres dialect of get_schema_names has duplicates (Ex: one copy of "main" for every database, including temp and system).
This is a draft because it has no tests! I just wanted to post here to get some quick feedback and I'll definitely add some tests in the next day or two. If you have specific advice or requests for tests, definitely let me know!
I tried to only wrap things in double quotes when absolutely necessary (if there are spaces or quotes within the database or schema name). Let me know if you think this will work!
One other factor is that we could go back and edit DuckDB core's pg_namespaces catalog to include the database name as the namespace. Then we could query pg_namespaces instead of duckdb_schemas. I'm not sure if that is something we want to do though!