dbt-labs / dbt-postgres

Apache License 2.0
31 stars 12 forks source link

[Bug] unordered set causing statements to be executed in incorrect order #72

Closed colin-rogers-dbt closed 6 months ago

colin-rogers-dbt commented 6 months ago

Is this a new bug?

Current Behavior

We use a set object to store SQL statements to be executed as part of an index operation. Because this is unordered this will occassionally cause us to execute statements in the wrong order. See: https://github.com/dbt-labs/dbt-postgres/blob/6a1897e6b00a60ae8c9ad762453b3a31ff244d2d/dbt/adapters/postgres/relation.py#L78

Expected Behavior

Statements are ordered correctly

Steps To Reproduce

Run this a couple of times:

 hatch run integration-tests:all tests/functional/materializations/materialized_view_tests/test_materialized_view.py::TestPostgresMaterializedViewChangesApply

Relevant log output

No response

Environment

- OS:
- Python:
- dbt-postgres:

Additional Context

No response

mikealfare commented 6 months ago

Re-opening for the backport.