Skip to content
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

fix: Don't preprocess database name when setting session catalog alias #2959

Merged
merged 1 commit into from
May 7, 2024

Conversation

scsmithr
Copy link
Member

@scsmithr scsmithr commented May 7, 2024

Previously we were doing some processing on the database name to try to extract out the "true" name from names that follow the "org/database" format. However that meant if someone connects to the db over postgres using a hostname like "proxy.glaredb.com/my_org/my_db", we would set the catalog alias to only "my_db", disallowing queries like SELECT * FROM "my_org/my_db"."my_schema"."my_table" even though that's a valid query given the connect string.

This change makes the name returned from SHOW database_name consistent with the alias we set on the session catalog, allowing the previous query to work as expected.

Previously we were doing some processing on the database to try to extract out
the "true" name from names that follow the "org/database" format. However that
meant if some connects to the db over postgres using a hostname like
"proxy.glaredb.com/my_org/my_db", we would set the catalog alias to only
"my_db", disallowing queries like `SELECT * FROM
"my_org/my_db"."my_schema"."my_table"` even though that's what's expected given
the postgres connection string.

This change makes the name returned from `SHOW database_name` consistent with
the alias we set on the session catalog, allowing the previous query to work as
expected.
@scsmithr scsmithr requested review from tychoish and talagluck May 7, 2024 17:54
@talagluck
Copy link
Contributor

I can't speak to the code here, but the functionality that you describe is as I expect.

@scsmithr scsmithr merged commit 6752f78 into main May 7, 2024
26 checks passed
@scsmithr scsmithr deleted the sean/fix-db-name branch May 7, 2024 20:55
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.

2 participants