You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to run dbt build, this fails with the following error:
syntax error at or near "create"
LINE 114: (parent_id)create index if not exists
The cause of which is obvious when looking at the code in target/run
create materialized view if not exists "kim"."intermediate"."int_hierarchy__basis"as
...
SELECT*FROM remove_nodes_without_type;
createindexif not exists
"5b1c4dda378142ef585f1dc654ac67f6"on"kim"."intermediate"."int_hierarchy__basis"
(parent_id)create index if not exists
"c9f64e20a2a1a629eb7bd92d46e5b9b2"on"kim"."intermediate"."int_hierarchy__basis"
(node_id)
Expected Behavior
I expect to be able to create the materialized view and both indexes without an error. This should probably be solvable by adding a semicolon (;) between the index definitions.
Steps To Reproduce
Create a materialized view in Postgres with two indexes;
Run dbt build;
This should error
Relevant log output
No response
Environment
- OS: MacOS
- Python: 3.11
- dbt: 1.8.0
Which database adapter are you using with dbt?
postgres
Additional Context
Looking at the macro's, it looks like the code for materialized views is different from the index-creating code for table, incremental and seed. I don't know why, but maybe the fix would be to bring those methods in line.
The text was updated successfully, but these errors were encountered:
Is this a new bug in dbt-core?
Current Behavior
I have a postgres materialized view with two indexes, defined as
When I try to run
dbt build
, this fails with the following error:The cause of which is obvious when looking at the code in
target/run
Expected Behavior
I expect to be able to create the materialized view and both indexes without an error. This should probably be solvable by adding a semicolon (
;
) between the index definitions.Steps To Reproduce
Relevant log output
No response
Environment
Which database adapter are you using with dbt?
postgres
Additional Context
Looking at the macro's, it looks like the code for materialized views is different from the index-creating code for table, incremental and seed. I don't know why, but maybe the fix would be to bring those methods in line.
The text was updated successfully, but these errors were encountered: