-
Notifications
You must be signed in to change notification settings - Fork 104
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
Case sensitivity for databases, schemas and identifiers #398
Comments
Any thoughts? Pinging @dataders @mikaelene for visibility, but anyone is more than welcome to chime in! |
Hi, I just like to say that I'm facing a problem related with that (at least I think it is). Using dbt-1.3.x version with dbt-fal, works great but upgrading to ^1.4.0, I'm getting this problem: |
@flunardelli I'm getting the same error, with dbt-core 1.4.6 and dbt-sqlserver 1.4.3 after running
|
Hi, @costructuralist. Actually I solved that problem with help from dbt-fal team. I submitted that issue to them and they were able to create a workaround for that sqlserver issue. Do you have a custom section "models" inside dbt_project.yml pointing to different schema/database name case (sorry for that obvious question, but I made that mistake)? |
Hi @flunardelli, thanks for the quick reply. My dbt_project.yml does not contain a custom "models" section. The issue was more innocent: the name of the database is actually This comment alerted me to the possibility: #321 (comment) |
This issue is meant to centralize thoughts around quoting and case sensitivity.
In dbt 1.5 new tests for the caching mechanism were added. These, once again, failed on issues related to quoting and case sensitivity. There have been numerous issues related to these topics in the past.
dbt-core is built around Postgres and in Postgres an identifier is case sensitive if it is surrounded with quotes. So the quoting defines the case sensitivity.
In T-SQL, an identifier is case sensitive if it's in a case sensitive collation. The collation can be set on multiple levels: database level and column level.
it seems that the Postgres implementation just ignores any casing in identifiers depending on the quoting policy. The question is how does this translate to T-SQL?
E.g. in Postgres when the adapter looks for a relation identified by
MODEL
, it will also give youmodel
andModel
and treat those as an exact match. While in SQL Server with a CS collation, those are 3 different models. But the quoting policy can still befalse
since they don't contain any special characters which would require quoting.Should always require users to enable quoting for case sensitive collations? And should we use that same policy to determine if we should just lowercase all models and treat them as equal?
The text was updated successfully, but these errors were encountered: