Closed ocastaneda-aily closed 2 months ago
Thanks for reporting this @ocastaneda-aily !
The root cause is the combination of the code within the following locations:
Since this looks like an issue that is specific to dbt-postgres, I'm going to transfer it to that repo, but it may end up moving to dbt-adapters.
Is this a new bug in dbt-core?
Current Behavior
When deploying to PostgreSQL, running a model for a Materialized View that has documentation in a schema.yml associated, it tries to run the command "comment on materialized_view ...." and PostgreSQL expects "comment on materialized view ... " (without the underscore character) otherwise it throws Syntax Error - which is happening now.
The problem is that DBT model config type for MV materialization is defined as "materialized_view" and this is not translated as "comment on materialized view ... " when deploying the comment on PostgreSQL.
Expected Behavior
DBT generates the correct comment command for PostgreSQL for Materialzied Views, which is "comment on materialized view ..." (without the underscore)
Steps To Reproduce
1- Create a model with materialization of materialized_view 2- Add description with a schema.yml 3- Execute dbt run -s configured to deploy on a PostgreSQL server
Relevant log output
Environment
Which database adapter are you using with dbt?
postgres
Additional Context
No response